Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky on Test: actionBlockStopsWhenMovedToAnotherState #487

Merged
merged 5 commits into from
May 9, 2023

Conversation

sockeqwe
Copy link
Collaborator

@sockeqwe sockeqwe commented May 6, 2023

The problem with the previous implementation was that it can take a few ms for FlowRedux to cancel the on<Action> {...} block. therefore we have introduced the delay(100) but since we did advanceUntilIdle() and runCurrent() on the TestDispatcher it skips the delay and it was sometimes still too fast (so cancelation happened afterward). That resulted in a flaky test.

Now I rephrased the test towards "Block is canceled within 10 milliseconds after having moved to another state"

Copy link
Member

@gabrielittner gabrielittner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think there are some more tests like this

@sockeqwe
Copy link
Collaborator Author

sockeqwe commented May 9, 2023

yea, I saw a few more. Would fix them once they became flaky (I actually started becoming a bit paranoid: "why are the others not flaky?" Maybe, also what I do here in this PR is wrong 😑 hahaha

@sockeqwe sockeqwe merged commit 181e18d into main May 9, 2023
4 checks passed
@sockeqwe sockeqwe deleted the fix_flaky_onAction_test branch May 9, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants