Repository navigation
test: Add test to verify graceful shutdown of in-flight requests - #292
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: nielsenko <[email protected]>
Co-authored-by: nielsenko <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
=======================================
Coverage 91.99% 91.99%
=======================================
Files 97 97
Lines 3662 3662
Branches 1881 1881
=======================================
Hits 3369 3369
Misses 293 293 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot Please use |
…behavior Co-authored-by: nielsenko <[email protected]>
Refactored the tests to use |
|
@copilot No need to skip the 'when server.close() is called, then new requests are not accepted after close begins' test?! |
…er approach Co-authored-by: nielsenko <[email protected]>
|
@copilot Address PR review |
Co-authored-by: nielsenko <[email protected]>
Co-authored-by: nielsenko <[email protected]>
|
@coderabbitai Create two follow-up issues:
|
|
@coderabbitai Create the issues in serverpod/relic repo. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 95 @nielsenko: I've successfully created both follow-up issues in the serverpod/relic repository:
Both issues reference PR #292 and include all the relevant context from our discussion. 🧠 Learnings used |
christerswahn
left a comment
There was a problem hiding this comment.
Had one question, otherwise looks good!
Description
Adds tests to verify that Relic's HTTP server allows in-flight requests to complete gracefully during shutdown rather than cutting connections immediately.
Tests added:
server.close()is calledImplementation details:
Completers for deterministic synchronization in single-isolate tests (avoids timing-based flakiness)Completers cannot cross isolate boundaries viaSendPort.send()serverClosedflag to prevent double-close in tearDown (callingclose()twice on a multi-isolate server causes a hang)(future1, future2).waitpattern consistently to await multiple futures simultaneously without leaving un-awaited futures across async gapsRelated Issues
Pre-Launch Checklist
Please ensure that your PR meets the following requirements before submitting:
///), ensuring consistency with existing project documentation.Breaking Changes
Additional Notes
Test results: 4 passing (total suite: 3376 tests passing).
The tests confirm that Dart's
HttpServer.close(force: false)does wait for in-flight requests to complete—Relic's current implementation handles graceful shutdown correctly.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.