From d82f125368d7d19300789ddd41587c09ffdcf36a Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Wed, 25 Sep 2019 19:21:42 +0300 Subject: Tests: fixed hanging of Go tests. This closes #319 issue on GitHub. --- test/unit/applications/lang/go.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'test/unit/applications/lang/go.py') diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py index 15ac1cd9..18345828 100644 --- a/test/unit/applications/lang/go.py +++ b/test/unit/applications/lang/go.py @@ -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,18 +24,23 @@ class TestApplicationGo(TestApplicationProto): env = os.environ.copy() env['GOPATH'] = self.pardir + '/go' - process = Popen( - [ - 'go', - 'build', - '-o', - self.testdir + '/go/' + name, - self.current_dir + '/go/' + script + '/' + name + '.go', - ], - env=env, - ) - process.communicate() + try: + process = Popen( + [ + 'go', + 'build', + '-o', + self.testdir + '/go/' + name, + self.current_dir + '/go/' + script + '/' + name + '.go', + ], + env=env, + ) + + process.communicate() + + except: + return None return process -- cgit