Commit 9b7fe29
Add regression test for subprocess timeout during large input write
Add test_communicate_timeout_large_input to verify that TimeoutExpired
is raised promptly when communicate() is called with large input and
a timeout, even when the subprocess doesn't consume stdin quickly.
This test currently passes on POSIX (where select() is used) but is
expected to fail on Windows where the stdin write blocks without
checking the timeout.
The test sends 128KB of input (larger than typical pipe buffers) to
a subprocess that sleeps for 3 seconds before reading. With a 0.5s
timeout, TimeoutExpired should be raised within a couple seconds, not
after the subprocess finishes sleeping.
After timeout, the test verifies that input continuation works by
calling communicate() again and checking all data was received
(testing the fix from gh-141473).
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 526d7a8 commit 9b7fe29
1 file changed
+56
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
995 | 1051 | | |
996 | 1052 | | |
997 | 1053 | | |
| |||
0 commit comments