Skip to content

test(engine): verify closed output removal in pin_distributor test#462

Merged
streamer45 merged 1 commit into
mainfrom
devin/1778957986-strengthen-pin-distributor-test
May 17, 2026
Merged

test(engine): verify closed output removal in pin_distributor test#462
streamer45 merged 1 commit into
mainfrom
devin/1778957986-strengthen-pin-distributor-test

Conversation

@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor

@staging-devin-ai-integration staging-devin-ai-integration Bot commented May 16, 2026

Summary

Strengthens the pin_distributor_removes_closed_outputs test to verify that the PinDistributorActor actually 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 via WithSubscriber. The actor emits tracing::warn! when it detects and removes a closed connection during fan-out. The test asserts:

  1. Exactly one warning fires after the first packet (closed-output detection + removal)
  2. Zero additional warnings after five subsequent packets (proving the closed output was cleaned up from the routing table)

This is a test-only change — no production code modified.

Closes #432

Review & Testing Checklist for Human

  • Verify the WarnCollector layer correctly captures only WARN-level events from the actor task (scoped via with_subscriber, not global)
  • Confirm the test would fail if the actor didn't remove the closed output (each subsequent packet would trigger another warning)

Notes

  • The WarnCollector struct and Visitor are 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 in connection_types.rs tests.

Link to Devin session: https://staging.itsdev.in/sessions/9a6c679373fd4b7898744e3a2f87173d
Requested by: @streamer45


Devin Review

Status Commit
🔴 Failed 610f096
Open in Devin Review (Staging)

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>
@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.91%. Comparing base (bddff06) to head (610f096).

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           
Flag Coverage Δ
backend 64.99% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 84.29% <ø> (ø)
engine 75.71% <ø> (+0.14%) ⬆️
api 84.73% <ø> (ø)
nodes 67.40% <ø> (ø)
server 57.18% <ø> (ø)
plugin-native 70.93% <ø> (ø)
plugin-wasm 6.37% <ø> (ø)
ui-services 74.73% <ø> (ø)
ui-components 60.49% <ø> (ø)
see 1 file with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@streamer45 streamer45 merged commit 9b46ab9 into main May 17, 2026
29 of 30 checks passed
@streamer45 streamer45 deleted the devin/1778957986-strengthen-pin-distributor-test branch May 17, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(engine): strengthen pin_distributor_removes_closed_outputs assertion

1 participant