13
13
import unittest .mock
14
14
from contextlib import contextmanager
15
15
from pathlib import Path
16
- from test .support import is_wasi , os_helper
16
+ from test .support import is_wasi , os_helper , SHORT_TIMEOUT
17
17
from test .support .os_helper import temp_dir , TESTFN , unlink
18
18
from typing import Dict , List , Optional , Tuple , Union , Any
19
19
@@ -415,7 +415,7 @@ def test_connect_and_basic_commands(self):
415
415
self ._send_command (client_file , "c" )
416
416
417
417
# Wait for process to finish
418
- stdout , _ = process .communicate (timeout = 5 )
418
+ stdout , _ = process .communicate (timeout = SHORT_TIMEOUT )
419
419
420
420
# Check if we got the expected output
421
421
self .assertIn ("Function returned: 42" , stdout )
@@ -458,7 +458,7 @@ def test_breakpoints(self):
458
458
459
459
# Continue to end
460
460
self ._send_command (client_file , "c" )
461
- stdout , _ = process .communicate (timeout = 5 )
461
+ stdout , _ = process .communicate (timeout = SHORT_TIMEOUT )
462
462
463
463
self .assertIn ("Function returned: 42" , stdout )
464
464
self .assertEqual (process .returncode , 0 )
@@ -467,7 +467,7 @@ def test_keyboard_interrupt(self):
467
467
"""Test that sending keyboard interrupt breaks into pdb."""
468
468
synchronizer_sock = socket .socket (socket .AF_INET , socket .SOCK_STREAM )
469
469
synchronizer_sock .bind (('127.0.0.1' , 0 )) # Let OS assign port
470
- synchronizer_sock .settimeout (5 )
470
+ synchronizer_sock .settimeout (SHORT_TIMEOUT )
471
471
synchronizer_sock .listen (1 )
472
472
self .addCleanup (synchronizer_sock .close )
473
473
sync_port = synchronizer_sock .getsockname ()[1 ]
@@ -529,7 +529,7 @@ def bar():
529
529
# Continue to end as fast as we can
530
530
self ._send_command (client_file , "iterations = 0" )
531
531
self ._send_command (client_file , "c" )
532
- stdout , _ = process .communicate (timeout = 5 )
532
+ stdout , _ = process .communicate (timeout = SHORT_TIMEOUT )
533
533
self .assertIn ("Function returned: 42" , stdout )
534
534
self .assertEqual (process .returncode , 0 )
535
535
@@ -547,7 +547,7 @@ def test_handle_eof(self):
547
547
client_file .flush ()
548
548
549
549
# The process should complete normally after receiving EOF
550
- stdout , stderr = process .communicate (timeout = 5 )
550
+ stdout , stderr = process .communicate (timeout = SHORT_TIMEOUT )
551
551
552
552
# Verify process completed correctly
553
553
self .assertIn ("Function returned: 42" , stdout )
@@ -597,7 +597,7 @@ def run_test():
597
597
self .assertIn ('protocol version' , message ['message' ])
598
598
599
599
# The process should complete normally
600
- stdout , stderr = process .communicate (timeout = 5 )
600
+ stdout , stderr = process .communicate (timeout = SHORT_TIMEOUT )
601
601
602
602
# Verify the process completed successfully
603
603
self .assertIn ("Test result: True" , stdout )
@@ -639,7 +639,7 @@ def test_help_system(self):
639
639
# Continue execution to finish the program
640
640
self ._send_command (client_file , "c" )
641
641
642
- stdout , stderr = process .communicate (timeout = 5 )
642
+ stdout , stderr = process .communicate (timeout = SHORT_TIMEOUT )
643
643
self .assertIn ("Function returned: 42" , stdout )
644
644
self .assertEqual (process .returncode , 0 )
645
645
@@ -697,7 +697,7 @@ def test_multi_line_commands(self):
697
697
# Continue execution to finish
698
698
self ._send_command (client_file , "c" )
699
699
700
- stdout , stderr = process .communicate (timeout = 5 )
700
+ stdout , stderr = process .communicate (timeout = SHORT_TIMEOUT )
701
701
self .assertIn ("Function returned: 42" , stdout )
702
702
self .assertEqual (process .returncode , 0 )
703
703
0 commit comments