From 2edd21bbfcc300e04932c836bc7512b280308121 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Wed, 8 Nov 2023 19:03:55 -0500 Subject: [PATCH] tests: Remove a test that's flaky under textual Everything this test exercises is also exercised by the `test_live_tracking_server_exits_properly_on_sigint` test that still remains in the `TestLiveRemoteSubcommand` class (same test name, different test class). That test uses `_wait_until_process_blocks` to ensure that the SIGINT is sent at a known point in the process's execution, but this one can't. With this test, the SIGINT is sometimes delivered while the TUI is still starting up, and at that point, the signal can result in exceptions (teardown of the TUI tries to access attributes that weren't created because startup was interrupted). So, remove this test and rely on the remaining one for coverage of how SIGINT behaves when interrupting our TUI. Signed-off-by: Matt Wozniski --- tests/integration/test_main.py | 38 ---------------------------------- 1 file changed, 38 deletions(-) diff --git a/tests/integration/test_main.py b/tests/integration/test_main.py index 64f28092b2..15f8c107bf 100644 --- a/tests/integration/test_main.py +++ b/tests/integration/test_main.py @@ -1546,44 +1546,6 @@ def test_live_tracking(self, tmp_path): # THEN assert server.returncode == 0 - def test_live_tracking_server_exits_properly_on_sigint(self, tmp_path): - # GIVEN - with track_and_wait(tmp_path) as program_file: - server = subprocess.Popen( - [ - sys.executable, - "-m", - "memray", - "run", - "--live", - str(program_file), - ], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env={"PYTHONUNBUFFERED": "1"}, - # Explicitly reset the signal handler for SIGINT to work around any signal - # masking that might happen on Jenkins. - preexec_fn=lambda: signal.signal( - signal.SIGINT, signal.default_int_handler - ), - ) - - # WHEN - - server.send_signal(signal.SIGINT) - try: - _, stderr = server.communicate(timeout=TIMEOUT) - except subprocess.TimeoutExpired: - server.kill() - raise - - # THEN - assert server.returncode == 0 - assert not stderr - assert b"Exception ignored" not in stderr - assert b"KeyboardInterrupt" not in stderr - class TestTransformSubCommands: def test_report_detects_missing_input(self):