From 1102ae4d7e08982e3790430156326a8d7fb2005a Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Fri, 1 Dec 2017 07:35:13 -0500 Subject: [PATCH] Skip editor orphaned test on windows. Tried SIGINT/SIGTERM, neither worked. Just skip this test on windows and go back to SIGUSR1 otherwise. --- tests/end2end/features/editor.feature | 2 ++ tests/end2end/features/test_editor_bdd.py | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature index 13e3deddc..4647eb08c 100644 --- a/tests/end2end/features/editor.feature +++ b/tests/end2end/features/editor.feature @@ -115,6 +115,8 @@ Feature: Opening external editors And I run :click-element id qute-button Then the javascript message "text: foobar" should be logged + # Could not get signals working on Windows + @posix Scenario: Spawning an editor and closing the tab When I set up a fake editor that waits And I open data/editor.html diff --git a/tests/end2end/features/test_editor_bdd.py b/tests/end2end/features/test_editor_bdd.py index 34c7e4248..983ded7ba 100644 --- a/tests/end2end/features/test_editor_bdd.py +++ b/tests/end2end/features/test_editor_bdd.py @@ -82,12 +82,8 @@ def set_up_editor_wait(quteproc, server, tmpdir): with open(r'{pidfile}', 'w') as f: f.write(str(os.getpid())) - signal.signal(signal.SIGINT, lambda s, f: sys.exit(0)) - - try: - time.sleep(100) - except InterruptedError: - pass + signal.signal(signal.SIGUSR1, lambda s, f: sys.exit(0)) + time.sleep(100) """.format(pidfile=pidfile))) editor = json.dumps([sys.executable, str(script), '{}']) quteproc.set_setting('editor.command', editor) @@ -98,4 +94,4 @@ def kill_editor_wait(quteproc, server, tmpdir): """Kill the waiting editor.""" pidfile = tmpdir / 'editor_pid' pid = int(pidfile.read()) - os.kill(pid, signal.SIGINT) + os.kill(pid, signal.SIGUSR1)