Repository navigation
fix(benchmark): treat a pcap engine's loader OSError as unmeasured, not fatal (#2129) - #2131
Merged
Merged
Conversation
…ot fatal (#2129) pcap-ct's libpcap loader raises OSError on macOS (dlopen libc.so.6) and Windows (npcap/wpcap.dll) with wording the harness did not match, so preflight("pypcap") re-raised and the whole pcap_ct environment exited. - preflight now asks the pcap module's import, through the probe the engines share, for pypcap and pcap_ct; a loader failure becomes the reason with its own message, and the other engines carry on - drop the "libpcap"-wording OSError match in _unavailable, so an OSError reading the capture stays a real failure - tests for both messages, and a README troubleshooting line
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 91.55% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
This closes #2129. |
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)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #2129.
pcap_ctenvironment,import pcapraisesOSErroron macOS (dlopen(libc.so.6 …)) and on Windows (Cannot find npcap/wpcap.dll).pcap_ctalready reports that through its ownunsupported_reason(), butpypcapdoes not. Soextract(engine='pypcap')raises, and_unavailablere-raised the error because the message lackslibpcap. The whole environment exited._loader_failure(engine)inpreflight, for the engines backed by_pcap_backend.DISTRIBUTIONSonly, asks_pcap_backend.probe(). If the module is installed but fails to import, the engine becomes an explained row carrying the realOSError. The'libpcap' in str(exc)wording check is gone, so anOSErrorreading the capture is always a real failure.TestLoaderFailureinexamples/benchmark/test_harness.pyfakes each runner's loader error. All 6 tests fail againstmain'sbenchmark.py, and the file gives 122 passed with the fix.PyPCAP._reason_fordoes not report an unusablepcapmodule the wayPCAP_CT._reason_fordoes. That is filed separately.