Skip to content

gh-132912: Use SHORT_TIMEOUT in test_remote_pdb #132939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Lib/test/test_remote_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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

Expand Down Expand Up @@ -414,7 +414,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)
Expand Down Expand Up @@ -457,7 +457,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)
Expand All @@ -466,7 +466,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]
Expand Down Expand Up @@ -521,7 +521,7 @@ def bar():
# Continue to end
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)

Expand All @@ -539,7 +539,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)
Expand Down Expand Up @@ -589,7 +589,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)
Expand Down Expand Up @@ -631,7 +631,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)

Expand Down Expand Up @@ -689,7 +689,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)

Expand Down
Loading