Repository navigation
test: make the time_limit hang guard robust to slow runners (#1058) - #1061
Conversation
- time_limit defaults to 30s, not 5s; the 19 call sites that passed 5 now take the default, and the three CASE_TIMEOUT constants rise from 10 to 30 - PCAPKIT_TEST_TIMEOUT_SCALE multiplies every deadline via scale_timeout, including the DEADLINE subprocess timeout in test_extraction_no_eof; a malformed value raises instead of being ignored - TimeLimitTests pins the new default, the scaling, rounding and refusal
|
Cross-review verdict on Required. A huge Optional. Confirmed:
|
…he try (#1058) - scale_timeout refuses a deadline scaled past MAX_TIMEOUT (one day); 1e9 overflowed signal.alarm's C int and 1e308 the float product - time_limit arms the alarm inside the try, so a failure while arming restores the previous handler, and leaves an enclosing alarm pending - test_release_gates' two subprocess timeouts go through scale_timeout
|
Cross-review verdict on
|
make pylint,make mypy,make isort) — N/A, nopcapkit/change;isort -l100clean on touched filestests/projectpass one module per process (fullmake testnot run)What is the purpose of your pull request?
test— tests onlyDescription
Closes #1058.
time_limitnow defaults to 30 s (was 5 s, which bodies of ~5 ms still overran on a loaded runner). The 19time_limit(5)sites take the default, and the threeCASE_TIMEOUTs rise from 10 s to 30 s, matchingEXTRACT_TIMEOUT/DEADLINE.PCAPKIT_TEST_TIMEOUT_SCALEmultiplies every deadline, includingDEADLINE's subprocess timeout. A malformed value raises; it is not ignored. CI does not set it (this PR doesn't touch.github/), so the 30 s default has to be safe without it. That bound is about 4000× a working body, and still well under #1059's 900 s per-testpytest-timeout.ABC growth: real, but it does not explain the overrun locally. Over 40
purge_modules(['pcapkit'])cycles, thecollections.abc.Mappingsubclass tree grows from 950 to 2822–3758, oscillating rather than climbing because gc reclaims old generations. Agc.collect()per cycle holds it at 2822. An uncachedisinstance(x, Mapping)scales with it, from 0.8 ms to 3–4 ms. In a 7-module internet slice in one process, the tree reached 5633, yet the slowesttime_limitbody was 6.9 ms (the issue's test). One module alone: 4.8 ms. The 5 s CI overrun is about 700× that, so runner stall is the likelier cause. UNVERIFIED: not reproduced.