Repository navigation
test(examples): wait for the refused session's release before disconnecting - #72
Conversation
…ecting TestGatewayRouteRefusesAndDisconnects flaked in CI with "closed 2 gateway connections, want 1". The refused session's handler flushes its terminal frame before its deferred release removes it from the connection registry, so on a slow runner the forced disconnect could still count it. Wait for the registry to drop it first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe gateway comparison test now waits for refused-session connections to close, adds a connection-count helper, and resets the forced-disconnect cleanup deadline. ChangesGateway connection cleanup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to The test waits for the refused session to be released before starting the viewer request. The reviewed change presents no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
Why
The release PR #71 is blocked by a flaky
kube adapter (go)check:The refused session's handler flushes its terminal FORBIDDEN frame and only then runs its deferred
release(), which removes it from the connection registry. The test reads the frame, closes the body and immediately forces a disconnect, so on a slow runner the refused connection can still be registered and gets counted.What
Test-only change: after closing the refused session, wait (up to 5s) until no
gatewayconnection is registered before forcing the disconnect. A smallopenConnectionshelper counts registered connections by kind.Verification
release()ingateway.goreproduces the exact CI failure with the old test; the new test passes under the same delay (delay not committed).go test -race ./...ingateway/kubepasses; the comparison package passes 300 runs under-race.🤖 Generated with Claude Code
Summary by CodeRabbit