test(engine): verify closed output removal in pin_distributor test#462
Merged
streamer45 merged 1 commit intoMay 17, 2026
Merged
Conversation
Strengthen pin_distributor_removes_closed_outputs to assert that the PinDistributorActor actually removes a closed downstream connection from its internal routing, not just that the open output still works. Use a tracing subscriber layer to capture warning events emitted by the actor. Assert exactly one warning fires on the first packet (closed-output detection) and zero additional warnings on five subsequent packets (proving the output was cleaned up). Closes #432 Signed-off-by: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #462 +/- ##
=======================================
Coverage 65.91% 65.91%
=======================================
Files 217 217
Lines 57496 57496
Branches 1597 1597
=======================================
+ Hits 37896 37899 +3
+ Misses 19594 19591 -3
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Strengthens the
pin_distributor_removes_closed_outputstest to verify that thePinDistributorActoractually removes a closed downstream connection from its internal routing — not just that the remaining open output still receives packets.Approach: Uses a custom
tracing_subscriber::Layer(WarnCollector) scoped to the actor's spawned task viaWithSubscriber. The actor emitstracing::warn!when it detects and removes a closed connection during fan-out. The test asserts:This is a test-only change — no production code modified.
Closes #432
Review & Testing Checklist for Human
WarnCollectorlayer correctly captures only WARN-level events from the actor task (scoped viawith_subscriber, not global)Notes
WarnCollectorstruct andVisitorare defined at module scope so they can be reused if other tests need warning-level assertion in the future.#[allow(clippy::unwrap_used)]follows the existing pattern inconnection_types.rstests.Link to Devin session: https://staging.itsdev.in/sessions/9a6c679373fd4b7898744e3a2f87173d
Requested by: @streamer45
Devin Review
610f096