Repository navigation
test(foundation): sequence the no_eof growing-file append on end of stream, not a timer (#1583) - #1587
Merged
Conversation
…tream, not a timer (#1583) The growing-file case appended its sixth frame from a thread after `time.sleep(0.6)` and asserted the extractor had already stopped. A loaded runner took longer than 0.6s to reach end of stream, read all six frames, and failed with `AssertionError: [1, 2, 3, 4, 5, 6]`. * The child now wraps the `warn` that `pcapkit.foundation.extraction` imports and appends the sixth frame inside the second `EOF reached` announcement, i.e. once the extractor has met end of stream, retried, and met it again at the same position. Five frames are taken with `next()` first; the case also asserts both ends of stream were met on the 430-byte file and that the append happened, so a pass is not vacuous. * The first announcement is deliberately not the trigger: the retry after it is for a paused capture, so a frame appended there is read. * The child bound and the SENTINEL protocol are unchanged. Fails on a18846c and 6c3d1b0 (child times out at 30s) and on scratch mutants that follow by file size or add a 0.2s grace; the old timer test passed the grace mutant 5/5. 30/30 passes under 32 CPU burners on 16 cores; the module is 11 passed.
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.63% (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.
make pylint,make mypy,make isort) — they lintpcapkit/, which is untouchedmake testpasses, and a test case covers the change (selections only, listed below)What is the purpose of your pull request?
test— tests onlyDescription of your pull request and other information
NoEOFOverAGrowingFileStopsAtWhatIsThereappended its sixth frame aftertime.sleep(0.6). On a loaded runner the extractor reached end of stream later than that, read six frames, and failed (job 114144569834).The child now takes five frames with
next(), wrapspcapkit.foundation.extraction.warn, and appends the sixth frame inside the secondEOF reachedannouncement. At that point the extractor has met end of stream, retried, and met it again at the same position. The test also asserts both ends of stream were seen on the 430-byte file and that the append happened. The first announcement is deliberately not the trigger: its retry exists for a paused capture, so a frame appended there is read. Measured: that variant gets[1, 2, 3, 4, 5, 6]. The child bound and the SENTINEL protocol are unchanged.Fails when the rule is broken. On
a18846c8f(#639's parent) and6c3d1b0d9, the child reads frame 6 and then times out at 30s. On scratch mutants that follow by file size or add a 0.2s grace, it gets[1, 2, 3, 4, 5, 6]. The old timer test passed the grace mutant 5/5.Ran (Python 3.14): the case 30/30 under 32 CPU burners on 16 cores (load ~35);
tests/foundation/test_extraction_no_eof.py11 passed;tests/project/test_per_class_import_guard.pyandtest_isort_clean.pypass.Closes #1583