https://github.com/python/cpython/commit/670b6cc096886a9154604456417a7fd306675bd0 commit: 670b6cc096886a9154604456417a7fd306675bd0 branch: main author: Victor Stinner <vstin...@python.org> committer: pablogsal <pablog...@gmail.com> date: 2025-04-25T14:00:26Z summary:
gh-132912: Use SHORT_TIMEOUT in test_remote_pdb (#132939) Replace hardcoded timeout of 5 seconds with SHORT_TIMEOUT. files: M Lib/test/test_remote_pdb.py diff --git a/Lib/test/test_remote_pdb.py b/Lib/test/test_remote_pdb.py index 6226a2563ba316..a1bef2d49bc85b 100644 --- a/Lib/test/test_remote_pdb.py +++ b/Lib/test/test_remote_pdb.py @@ -13,7 +13,7 @@ import unittest.mock from contextlib import contextmanager from pathlib import Path -from test.support import is_wasi, os_helper +from test.support import is_wasi, os_helper, SHORT_TIMEOUT from test.support.os_helper import temp_dir, TESTFN, unlink from typing import Dict, List, Optional, Tuple, Union, Any @@ -415,7 +415,7 @@ def test_connect_and_basic_commands(self): self._send_command(client_file, "c") # Wait for process to finish - stdout, _ = process.communicate(timeout=5) + stdout, _ = process.communicate(timeout=SHORT_TIMEOUT) # Check if we got the expected output self.assertIn("Function returned: 42", stdout) @@ -458,7 +458,7 @@ def test_breakpoints(self): # Continue to end self._send_command(client_file, "c") - stdout, _ = process.communicate(timeout=5) + stdout, _ = process.communicate(timeout=SHORT_TIMEOUT) self.assertIn("Function returned: 42", stdout) self.assertEqual(process.returncode, 0) @@ -467,7 +467,7 @@ def test_keyboard_interrupt(self): """Test that sending keyboard interrupt breaks into pdb.""" synchronizer_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) synchronizer_sock.bind(('127.0.0.1', 0)) # Let OS assign port - synchronizer_sock.settimeout(5) + synchronizer_sock.settimeout(SHORT_TIMEOUT) synchronizer_sock.listen(1) self.addCleanup(synchronizer_sock.close) sync_port = synchronizer_sock.getsockname()[1] @@ -529,7 +529,7 @@ def bar(): # Continue to end as fast as we can self._send_command(client_file, "iterations = 0") self._send_command(client_file, "c") - stdout, _ = process.communicate(timeout=5) + stdout, _ = process.communicate(timeout=SHORT_TIMEOUT) self.assertIn("Function returned: 42", stdout) self.assertEqual(process.returncode, 0) @@ -547,7 +547,7 @@ def test_handle_eof(self): client_file.flush() # The process should complete normally after receiving EOF - stdout, stderr = process.communicate(timeout=5) + stdout, stderr = process.communicate(timeout=SHORT_TIMEOUT) # Verify process completed correctly self.assertIn("Function returned: 42", stdout) @@ -597,7 +597,7 @@ def run_test(): self.assertIn('protocol version', message['message']) # The process should complete normally - stdout, stderr = process.communicate(timeout=5) + stdout, stderr = process.communicate(timeout=SHORT_TIMEOUT) # Verify the process completed successfully self.assertIn("Test result: True", stdout) @@ -639,7 +639,7 @@ def test_help_system(self): # Continue execution to finish the program self._send_command(client_file, "c") - stdout, stderr = process.communicate(timeout=5) + stdout, stderr = process.communicate(timeout=SHORT_TIMEOUT) self.assertIn("Function returned: 42", stdout) self.assertEqual(process.returncode, 0) @@ -697,7 +697,7 @@ def test_multi_line_commands(self): # Continue execution to finish self._send_command(client_file, "c") - stdout, stderr = process.communicate(timeout=5) + stdout, stderr = process.communicate(timeout=SHORT_TIMEOUT) self.assertIn("Function returned: 42", stdout) self.assertEqual(process.returncode, 0) _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com