Reduce flakiness in unicast authorization tests#8603
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
📝 WalkthroughWalkthroughAdded a ChangesUnicast authorization test error handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Problem
The rejection-path tests in
TestUnicastAuthorizationTestSuiteintermittently fail with a benignstream reseterror on the sender'sUnicastcall. When the receiver rejects an unauthorized message it resets the inbound stream, which races with the sender closing its side. The error is documented as benign, but the tests assertedrequire.NoError.Example failing CI run: https://github.com/onflow/flow-go/actions/runs/28946085223/job/85880463137
Change
Replace
require.NoErrorwith a helper (requireStreamAcceptedOrReset) in the rejection-path tests, which tolerates astream reseterror while still failing on any other error. Happy-path tests are unchanged. The authoritative assertion (violation reported via the slashing violations consumer) is preserved.Summary by CodeRabbit