Fix test race flake: hot rxjs observable was emitting event before it had subscribers.#2164
Open
cconstable wants to merge 1 commit into
Open
Fix test race flake: hot rxjs observable was emitting event before it had subscribers.#2164cconstable wants to merge 1 commit into
cconstable wants to merge 1 commit into
Conversation
… had subscribers.
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.
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
SubjecttoReplaySubjectso events are replayed to subscribers.Why?
test-async-completion.tscallsclient.activity.start('completeAsync', {...})which emits an event (async) but doesn't subscribe to that event until the following line. I opted to useReplaySubjectinstead of reorder every test because the replay subject will fix the issue regardless if the test logic is written in order.