Skip to content

tests: bound test_gossip_throttle by what the throttle guarantees - #9660

Open
ksedgwic wants to merge 1 commit into
ElementsProject:masterfrom
ksedgwic:gossip-throttle-test-bound
Open

ksedgwic wants to merge 1 commit into
ElementsProject:masterfrom
ksedgwic:gossip-throttle-test-bound

Conversation

@ksedgwic

Copy link
Copy Markdown
Collaborator

test_gossip_throttle's three-second bound predates the August recalibration of the test throttle rate and delay (5134ee4): the 17 messages now take two or three waits depending on how they pack into the one-second windows, and two waits fail the bound. Assert the certain part, one wait of at least a second, and check the throttle's log line for each throttled connection.

Fixes #9659

The test required the throttled peer to take more than three seconds
for 17 messages. That bound came from the 500 bytes per second
--dev-throttle-gossip allowed when the test was written. 5134ee4
raised the test rate to 1000 bytes per second and made the delay
proportional with a one-second floor, so the 3,582 bytes now need
two or three waits of a little over a second, and which it is depends
on how the messages pack into the one-second windows. Two waits take
2.4 to 2.9 s and fail the bound.

What the throttle guarantees is one wait of at least a second once a
window is over budget, which these messages always are. Assert that,
and check the throttle engaged through connectd's log line, which is
written once per peer connection.

Fixes: ElementsProject#9659
Changelog-None

This branch has not been deployed

No deployments
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.

test_gossip_throttle's 3-second bound predates the proportional throttle delay

1 participant