fix(test): robust flowshape check (dense-cluster span) #159
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/yip!159
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/flowshape-cluster-span"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fixes the intermittent
flowshape_not_obviously_constantfailure in the privileged sudo CI job (surfaced on PR #158, issue #157). Independent of #158's content — the sudo job just runs the whole netns suite.Root cause
The test counted the leading run of handshake datagrams up to the first inter-packet gap > 5ms. That 5ms was calibrated on an idle dev box (intra-burst gaps are microseconds). On the contended CI runner a scheduling stall > 5ms lands mid junk-burst and truncates the run: a ~15–20 datagram burst gets counted as 4–6, tripping gate (a) (
> 4). The failing run showed counts7 12 4 10 8 11 7 19— half below the structural floor of 9, so this was systematic truncation, not a one-off.Why no threshold value fixes it
Inspecting real captures: a ~30ms round-trip wait happens inside the handshake, and steady-state feedback (two independent ~30ms streams) produces coincident sub-ms pairs. So gap magnitude alone can't tell which phase a packet is in — any single cutoff either truncates mid-burst or plows into steady state.
Fix
Count the dense-cluster span: the index of the last datagram in a run of ≥3 packets spaced <1ms apart. The handshake is built of such dense clusters (junk bursts, Inits, Noise completion); steady state never forms a ≥3 dense run (only coincident pairs). A scheduling stall can't truncate this — it merely splits one dense cluster into two, both still counted.
Re-derived gate (measured, junk-on vs junk-off, idle + 2× CPU oversubscription)
Gate (a) is now
span > 12(strictly between). Verified min span 16–17 under load harsher than CI; both gates green. Added a density-valley diagnostic (max intra-cluster vs min separator gap) so any future failure is self-explaining, and deleted the now-deadGAP_THRESHOLD_S.