Skip to content

tests: compare medians in test_no_delay instead of means#9330

Open
ksedgwic wants to merge 1 commit into
ElementsProject:masterfrom
ksedgwic:fix-test-no-delay-median
Open

tests: compare medians in test_no_delay instead of means#9330
ksedgwic wants to merge 1 commit into
ElementsProject:masterfrom
ksedgwic:fix-test-no-delay-median

Conversation

@ksedgwic

Copy link
Copy Markdown
Collaborator

test_no_delay compares mean round-trip times with a 3-standard-error margin. On loaded CI runners the trip-time distribution is heavy-tailed enough that the margin can exceed the entire effect being measured: in the #9329 failure the margin came to 45.3ms while the measured saving was 44.6ms - and the true Linux effect comes in 40ms delayed-ACK quanta (the old docstring's ~200ms figure is other platforms), so the assertion failed with the effect cleanly present.

The Nagle stall shifts the whole distribution by whole quanta, so the median difference detects it regardless of the noise tail. Compare medians, requiring half a quantum on Linux; platforms without a measurable stall keep the not-slower sanity check with the same slack.

Measured locally on an idle machine: median trip 196.6ms with Nagle vs 113.4ms without, an 83.3ms median saving (two quanta - a payment round trip contains several stalled exchanges) against the 20ms the assertion requires.

Fixes #9329

test_no_delay compares mean round-trip times with a 3-standard-error
margin.  On loaded CI runners the trip-time distribution is heavy-tailed
enough that the margin can exceed the entire effect being measured: in
the ElementsProject#9329 failure the margin came to 45.3ms while the true Linux effect
is one delayed-ACK quantum (40ms - the docstring's ~200ms figure is
other platforms), so the assertion failed with the effect cleanly
present (saving 44.6ms).

The stall shifts the whole distribution by the quantum, so the median
difference detects it regardless of the noise tail.  Compare medians,
requiring half the quantum on Linux; on platforms without a measurable
stall keep the not-slower sanity check with the same slack.

Fixes: ElementsProject#9329
Changelog-None
@ksedgwic

Copy link
Copy Markdown
Collaborator Author

The Update examples in doc schemas failure here is #9327 (the listchannels disabled/enabled race) - byte-identical to the earlier occurrences, third unrelated PR it has hit today. Fix proposed in #9328.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI flake test_no_delay (recurrence after #9231)

1 participant