diff --git a/meson.build b/meson.build index 6a6dad2b..03e4394b 100644 --- a/meson.build +++ b/meson.build @@ -610,7 +610,7 @@ if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimi test('tool-option-parsing', find_program('tools/test-tool-option-parsing.py'), args : ['--tool-path', libinput_tool.full_path()], - timeout : 120) + timeout : 240) endif # the libinput tools check whether we execute from the builddir, this is diff --git a/tools/test-tool-option-parsing.py b/tools/test-tool-option-parsing.py index 1ea3a47b..6cdcf658 100755 --- a/tools/test-tool-option-parsing.py +++ b/tools/test-tool-option-parsing.py @@ -41,12 +41,14 @@ class TestLibinputTool(unittest.TestCase): args.insert(1, self.subtool) with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p: - time.sleep(0.1) - p.send_signal(3) # SIGQUIT - p.wait() + try: + p.wait(0.7) + except subprocess.TimeoutExpired: + p.send_signal(3) # SIGQUIT + stdout, stderr = p.communicate(timeout=2) if p.returncode == -3: p.returncode = 0 - return p.returncode, p.stdout.read().decode('UTF-8'), p.stderr.read().decode('UTF-8') + return p.returncode, stdout.decode('UTF-8'), stderr.decode('UTF-8') def run_command_success(self, args): rc, stdout, stderr = self.run_command(args)