Skip to content

automaton, test: fix Windows select_objects index mapping and stabilize TLS test timeouts - #5227

Closed
BenGardiner wants to merge 1 commit into
secdev:masterfrom
BenGardiner:fix-windows-select-objects-races
Closed

BenGardiner wants to merge 1 commit into
secdev:masterfrom
BenGardiner:fix-windows-select-objects-races

Conversation

@BenGardiner

Copy link
Copy Markdown
Contributor

Description

  1. In scapy/automaton.py, select_objects() on Windows handles objects with negative file descriptors by appending them directly to results and omitting them from events. When WaitForMultipleObjects returns an event index, looking up inputs[res] was offset by
    any preceding negative-fileno objects, resulting in incorrect return sets. Map events to input objects explicitly via events_to_inputs.
  2. In test/scapy/layers/tls/tlsclientserver.uts, increase the handshake request timeout in test_tls_client_native from 1s to 5s to avoid intermittent timeouts on CPU-throttled Windows CI runners.
  3. In test/windows.uts, add unit test coverage for select_objects when inputs contain negative file descriptor objects.

with the assistance of AI: Yes
AI-Assisted: yes (Gemini 3.8 Flash)

fixes: intermittent test failures in the windows-latest 3.14 root -K scanner CI job on upstream Scapy master

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.02%. Comparing base (aa87edd) to head (8c52a29).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5227      +/-   ##
==========================================
- Coverage   79.25%   78.02%   -1.24%     
==========================================
  Files         394      376      -18     
  Lines       98742    98354     -388     
==========================================
- Hits        78261    76739    -1522     
- Misses      20481    21615    +1134     
Files with missing lines Coverage Δ
scapy/automaton.py 80.22% <100.00%> (+0.13%) ⬆️

... and 316 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BenGardiner
BenGardiner force-pushed the fix-windows-select-objects-races branch from 309b276 to f70b6ed Compare October 14, 2026 14:13
@BenGardiner

Copy link
Copy Markdown
Contributor Author

😔

…ze TLS test timeouts

In scapy/automaton.py, select_objects() on Windows handles objects with
negative file descriptors (such as PcapReader) by appending them directly
to results and omitting them from events. When WaitForMultipleObjects returns
an event index, looking up inputs[res] was offset by any preceding
negative-fileno objects, resulting in incorrect return sets. Map events
to input objects explicitly via events_to_inputs.

In test/scapy/layers/tls/tlsclientserver.uts, increase the server accept and
client handshake request timeouts in test_tls_client_native from 1s to 5s to
avoid intermittent timeouts on CPU-throttled Windows CI runners.

In test/windows.uts, add unit test coverage for select_objects when inputs
contain negative file descriptor objects.

AI-Assisted: yes (GPT-5.6-Cyber)
@BenGardiner
BenGardiner force-pushed the fix-windows-select-objects-races branch from f70b6ed to 8c52a29 Compare October 18, 2026 23:35
@BenGardiner

Copy link
Copy Markdown
Contributor Author

Closing in favor of #5234, which incorporates these changes alongside upstream CI test fixes.

This message was written with the help of AI (GPT-5.6-Cyber).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants