Skip to content

Fix flaky spec for awaited fetch request#7039

Merged
aduth merged 3 commits intomainfrom
aduth-await-fetch-flakiness
Sep 28, 2022
Merged

Fix flaky spec for awaited fetch request#7039
aduth merged 3 commits intomainfrom
aduth-await-fetch-flakiness

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Sep 28, 2022

🛠 Summary of changes

Resolves intermittent test failures caused by a race condition between user interaction in the feature spec and the JavaScript fetch request being settled.

Related Slack discussion: https://gsa-tts.slack.com/archives/C0NGESUN5/p1664317848054629

There should be a way to have the test helper work as expected, but this appears to work as a simpler alternative. The issue with the test helper appears to be that the Timeout.timeout loop only loops once and does not actually wait for window.isFetching to become false.

📜 Testing Plan

  • rspec spec/features/users/sign_in_spec.rb:220

changelog: Internal, Analytics, Add logging for password visibility toggle clicked
Copy link
Contributor

@eric-gade eric-gade left a comment

Choose a reason for hiding this comment

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

Looks good, and works on my end

@aduth aduth merged commit 7415a07 into main Sep 28, 2022
@aduth aduth deleted the aduth-await-fetch-flakiness branch September 28, 2022 13:06
@solipet solipet mentioned this pull request Sep 29, 2022
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.

2 participants