Skip to content

Concurrent stream cancellation test flakes when event bus receiver lags #231

Description

@acoliver

Summary

services::chat_impl::tests::concurrent_streams::cancel_emits_event_only_for_target can fail after a cold build, then pass repeatedly without source changes.

Observed behavior

During local verification, the test failed twice immediately after a cold compile. It then passed in nine consecutive reruns, including a six-run stress loop.

Suspected cause

The test drains a capacity-16 global broadcast event bus with a while let Ok(...) = try_recv() pattern. If the receiver reports Lagged, that loop stops before reaching the event under test. Concurrent tests can publish enough events to make this timing-dependent.

Expected behavior

The test should distinguish an empty receiver from a lagged receiver and continue draining after lag, or use isolated event capture so unrelated concurrent events cannot make the assertion flaky.

Scope note

No production behavior failure was observed. This issue tracks test reliability only; no unrelated changes were included in the stream-failure fix where the flake was encountered.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions