test: fix flaky v2transport_test off-by-one in Dash short ID range#7097
Conversation
The test was generating "unknown" short IDs in range [168, 255], but 168 is PLATFORMBAN (last valid Dash ID). When InsecureRandRange(88) returned 0, the test would send a valid message that decoded successfully, causing the BOOST_CHECK(!(*ret)[0]) assertion to fail. Fix by starting the invalid range at 169 instead of 168. Fixes dashpay#7093 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughA test in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)src/**/*.{cpp,h,hpp,cc}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/{test,wallet/test}/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-11-24T16:41:22.457ZApplied to files:
📚 Learning: 2025-08-08T07:01:47.332ZApplied to files:
🧬 Code graph analysis (1)src/test/net_tests.cpp (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (2)
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 |
Issue being fixed or feature implemented
The test was generating "unknown" short IDs in range [168, 255], but 168 is PLATFORMBAN (last valid Dash ID). When InsecureRandRange(88) returned 0, the test would send a valid message that decoded successfully, causing the BOOST_CHECK(!(*ret)[0]) assertion to fail.
Follow-up to #7082
What was done?
Fix by starting the invalid range at 169 instead of 168.
Fixes #7093
How Has This Been Tested?
Run
./src/test/test_dash --run_test=net_tests/v2transport_testin a loopBreaking Changes
n/a
Checklist: