test(proto): keep test connections on their initial keys - #798
Open
n0-grookie wants to merge 1 commit into
Open
Conversation
A fresh connection picks its first key phase at random (10..1000 packets) so that peers which mishandle key updates fail early rather than late. For a test that is not about key updates that is an unscheduled event: the update arms a KeyDiscard timer shortly after, at a point no test can predict. It is what made open_path_validation_fails_server_side fail in the daily runs, where the test was waiting for a PathIdle timer 8s out (PR n0-computer#797). ConnPairBuilder now sets TransportConfig::initial_key_phase_size to a size no test reaches, so a built pair keeps its initial keys, and with_key_update() opts back in. Pair::seeded() is left alone, so the proptests and the random-interaction harness keep the autonomous update in the mix.
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.
Description
Every connection starts with a short first key phase — 10..1000 packets, drawn at random in
CryptoState::new— so that peers which mishandle key updates fail early. In a test that is not about key updates, that is an unscheduled event with consequences: it arms aKeyDiscardtimer shortly afterwards, at a point the test cannot predict. That is what madetests::multipath::open_path_validation_fails_server_sidefail intermittently in the daily CI runs, which #797 fixes for that one test.flub suggested in that review that the harness should not be subject to key updates at all, and matheus23 agreed it should be its own PR.
ConnPairBuildernow setsTransportConfig::initial_key_phase_sizeto a size no test reaches, so a built pair stays on its initial keys, withwith_key_update()to opt back in.Pair::seeded()is left alone, so the proptests keep exercising the autonomous update.API Changes
None, test changes only. The knob is a
#[cfg(test)]field onTransportConfig, alongsidedeterministic_packet_numbers.Notes & open questions
n0-grookie, the agent account, from the review thread on test(proto): fix flaky open_path_validation_fails_server_side #797.cargo makegreen locally.with_key_update().Pair::default()/Pair::new(), ~100 call sites) should get the same default. Those tests build their ownTransportConfig, so they keep production behaviour.Change checklist
proposed change and wrote an as clear and concise description as
they could.
cargo makepasses locally.