Repository navigation
test(generators): scale the option generator's per-case deadline by PCAPKIT_TEST_TIMEOUT_SCALE (#1428) - #1439
Merged
Conversation
…CAPKIT_TEST_TIMEOUT_SCALE (#1428) The 5-second signal.alarm budget in examples/generators/options.py was flat wall-clock time, so a stalled CI runner failed a ~1.3 ms HTTP/2 case as 'TIMEOUT'. The default is now 30 s, the budget test_option_roundtrip_unit already gives the same cycle, and scale_deadline() stretches it by PCAPKIT_TEST_TIMEOUT_SCALE with the contract of tests._support.scale_timeout: blank means unscaled, a non-positive or non-numeric value or one past a day is refused with ValueError before any handler is installed, and deadline=0 stays off. The 'TIMEOUT' outcome and its "did not finish within Ns" detail are kept, naming the seconds actually allowed.
Owner
Author
|
Verdict: GOOD TO GO at
Nits, no change needed:
|
Contributor
|
Coverage: 89.48% (unit tier, Python 3.14,
Per-file detail: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pylint,mypy,isortrun on the two files: no new findings;tests/project/test_isort_clean.pypasses)make testpasses, and a test case covers the change (only the modules listed below were run)What is the purpose of your pull request?
test— tests onlyCloses #1428
DEADLINEgoes from 5 s to 30 s, the per-case budgettest_option_roundtrip_unitalready gives the same cycle. A working case takes ~1–5 ms. A real hang still trips it.scale_deadline()stretches it byPCAPKIT_TEST_TIMEOUT_SCALE, with the same contract astests._support.scale_timeout. It reads the variable directly, because the generator is a standalone script. Blank means unscaled.0, negative,nan,inf, non-numeric, or past 86400 s raiseValueErrorbefore any handler is installed.deadline=0stays off.'TIMEOUT'and thedid not finish within Nsdetail are unchanged. N is now the seconds actually allowed.tests/protocols/test_option_generator_deadline_scale_1428_unit.py: 7 tests. Againstmain'soptions.py: 15 failed, 5 passed. With this change: 7 passed, 13 subtests.make_samples.pybefore and after: all 23 captures have the same md5.test_support_helpers, andtests/project(404 passed). Ordering legprotocols --exclude protocols/internet: 1091 tests, OK.PCAPKIT_TEST_TIMEOUT_SCALEanywhere in.github/workflows/. This PR does not edit workflows.