[Squad] Randomize previously-disabled SpinQuic settings to improve coverage - #6204
Open
Gaurav Singh (gaurav2699) wants to merge 7 commits into
Open
[Squad] Randomize previously-disabled SpinQuic settings to improve coverage#6204Gaurav Singh (gaurav2699) wants to merge 7 commits into
Gaurav Singh (gaurav2699) wants to merge 7 commits into
Conversation
SpinQuicRandomizeSettings left many settings unexercised: - 8 boolean settings used GetRandom((uint8_t)1) (== value % 1 == 0, always disabled); changed to GetRandom((uint8_t)2) so they toggle. - Re-enabled 26 commented-out numeric setting cases to exercise settings.c validation/apply/reject branches. - Added SendBufferingEnabled and NetStatsEventEnabled randomization. - EncryptionOffloadAllowed left disabled: random-enabling it on a started connection trips CXPLAT_FRE_ASSERT(FALSE) at connection.c:7742 (false-positive spin failure, not a real bug). Only the SpinQuic test tool changes; no production code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6204 +/- ##
==========================================
- Coverage 86.02% 85.05% -0.97%
==========================================
Files 60 60
Lines 18984 18989 +5
==========================================
- Hits 16331 16152 -179
- Misses 2653 2837 +184 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Condense the EncryptionOffloadAllowed pinning note to two lines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…gaurasingh/spinquic-settings-coverage
Guillaume Hetier (guhetier)
left a comment
Collaborator
There was a problem hiding this comment.
Please make the CI is green and run the spin test multiple times in a loop both locally and in the CI to catch issues before we merge this.
Bounded GetRandom(UpperBound) returns value % UpperBound, so passing UINTxx_MAX can never yield the maximum value, and on the non-fuzz path rand() % (int)UINT32_MAX degenerates to 0. That left the boundary most likely to expose off-by-one/wraparound bugs in settings validation untested. Add a full-width GetRandom<T>() overload (and a no-modulo TryGetRandomFull) and use it for the UINTxx_MAX-bounded settings cases and the stream/connection param randomizers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d1480271-874a-495f-a1d6-9baa5795b616
Addresses review feedback: give the descriptive suffix to the bounded variant rather than an unclear "Full" suffix on the simpler unbounded one. TryGetRandomFull becomes the plain TryGetRandom. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d1480271-874a-495f-a1d6-9baa5795b616
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.
SpinQuicRandomizeSettings left many settings unexercised:
Testing
Do any existing tests cover this change? Are new tests needed?
Documentation
Is there any documentation impact for this change?