Conversation
The "rotates deliveries across multiple recipients" test failed intermittently on CI with only Alice's inbox hit. It ran a closed-loop load for a 300ms real-clock window with the default pipeline signing mode, and neither part guaranteed that Bob's inbox would see a delivery: - The closed-loop workers stop dispatching once the real-time deadline passes, so a slow first round (a cold target dereferencing the synthetic actors, the baseline stats request, CI scheduling) could leave only one or two deliveries. - The runner allocates recipients round-robin by signing index, but pipeline mode fills its buffer from four concurrent signers in completion order, so the prefix actually dispatched can contain only one recipient's requests. The runner itself allocates correctly; only the test's assumptions were wrong. The test now makes a fixed number of attempts: four constant open-loop arrivals (10/s over 400ms) under a fake clock, so the count no longer depends on real time. It runs once with jit signing and once with presign signing. In both modes each attempt consumes exactly one allocation index (presign signs exactly the four requests and the run consumes them all), so the deliveries split exactly two per recipient regardless of completion order. The target now counts POSTs per inbox path so the test can assert that exact split. Fixes fedify-dev#1218 Changelog: none Assisted-by: Claude Code:claude-opus-5-5 Assisted-by: Codex:gpt-6-astra
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe inbox benchmark test target now counts POSTs per inbox path. The allocation test uses a fake clock to check delivery counts for JIT and presigned signing. ChangesInbox allocation tests
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The allocation test reliably checks four deliveries and an even split between recipients. It is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
34db2c1 to
f365df5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Fixes #1218.
Why it flaked
The runner assigns recipients round-robin by signing index, and that part is correct. The test, though, guaranteed neither enough deliveries nor a balanced split. A slow first round on CI could leave the 300ms closed-loop run with only one or two deliveries. In the default
pipelinemode, four concurrent signers fill the buffer in completion order, so every dispatched request could target Alice.How it's fixed
The test now schedules exactly four attempts: constant open-loop arrivals at 10/s over 400ms, under the fake clock pattern from failure.test.ts. Delivery and signature verification stay real; only the schedule is detached from wall-clock time. The open loop doesn't wait on completions to decide when to stop, so a failing request shows up as a failed assertion rather than a hang.
It runs in both
jitandpresignmodes. Each attempt uses exactly one allocation index, so each recipient gets two deliveries regardless of completion order. Presign signs four requests and the run consumes all four, which keeps buffered-mode coverage. Defaultpipelinemode can't promise that split because it consumes an arbitrary prefix of a 256-entry buffer.The target counts POSTs per inbox path, and the test asserts exactly two for each recipient instead of just checking that both were hit. Breaking the rotation makes both tests fail.
No CHANGES.md entry for this test-only change. The warm-up test in the same file has a similar timing dependency, tracked in #1219.