-
Notifications
You must be signed in to change notification settings - Fork 12
test: Add test to verify graceful shutdown of in-flight requests #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <22237677+nielsenko@users.noreply.github.com>
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
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 <22237677+nielsenko@users.noreply.github.com>
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 <22237677+nielsenko@users.noreply.github.com>
|
@copilot Address PR review |
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
Co-authored-by: nielsenko <22237677+nielsenko@users.noreply.github.com>
|
@coderabbitai Create two follow-up issues:
|
|
@coderabbitai Create the issues in serverpod/relic repo. |
nielsenko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had one question, otherwise looks good!
SandPod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 👍
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.