Skip to content

Fix test race flake: hot rxjs observable was emitting event before it had subscribers.#2164

Open
cconstable wants to merge 1 commit into
mainfrom
flake/ava-timeout
Open

Fix test race flake: hot rxjs observable was emitting event before it had subscribers.#2164
cconstable wants to merge 1 commit into
mainfrom
flake/ava-timeout

Conversation

@cconstable

@cconstable cconstable commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

A hot rxjs observable was occasionally emitting an event before it had subscribers causing tests to timeout waiting for a value.

What was changed

Change Subject to ReplaySubject so events are replayed to subscribers.

Why?

test-async-completion.ts calls client.activity.start('completeAsync', {...}) which emits an event (async) but doesn't subscribe to that event until the following line. I opted to use ReplaySubject instead of reorder every test because the replay subject will fix the issue regardless if the test logic is written in order.

@cconstable cconstable requested a review from a team as a code owner July 7, 2026 01:16
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.

1 participant