Tests: fixed hanging of Go tests.

This closes #319 issue on GitHub.
This commit is contained in:
Andrey Zelenkov
2019-09-25 19:21:42 +03:00
parent 5c6b01d76c
commit d82f125368
2 changed files with 24 additions and 14 deletions

View File

@@ -12,7 +12,8 @@ class TestApplicationGo(TestApplicationProto):
go_app = TestApplicationGo()
go_app.testdir = unit.testdir
if go_app.prepare_env('empty', 'app').returncode == 0:
proc = go_app.prepare_env('empty', 'app')
if proc and proc.returncode == 0:
cls.available['modules']['go'] = []
return unit if not complete_check else unit.complete()
@@ -23,6 +24,8 @@ class TestApplicationGo(TestApplicationProto):
env = os.environ.copy()
env['GOPATH'] = self.pardir + '/go'
try:
process = Popen(
[
'go',
@@ -36,6 +39,9 @@ class TestApplicationGo(TestApplicationProto):
process.communicate()
except:
return None
return process
def load(self, script, name='app'):

View File

@@ -63,9 +63,13 @@ class TestApplicationJava(TestApplicationProto):
]
javac.extend(src)
try:
process = Popen(javac)
process.communicate()
except:
self.fail('Cann\'t run javac process.')
self._load_conf(
{
"listeners": {"*:7080": {"pass": "applications/" + script}},