Try: Fix second MFA reminder flakey spec #11109
Merged
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.
🛠 Summary of changes
Attempts to resolve an issue where the "Second MFA Reminder user with multiple mfas who would otherwise be candidate does not prompt the user on sign in" spec occasionally fails in continuous integration.
Example: https://gitlab.login.gov/lg/identity-idp/-/jobs/1371605
It's not entirely clear what causes this, but it's hypothesized that something with the time travel in the existing implementation results in the user arriving at the sign-in page rather than the account page.
The changes here reorganize the test to avoid relying on time helpers, and instead stub the user in a way where the account is old enough to be prompted for the second MFA reminder.
This also has the upside of avoiding magic numbers within the test (
travel 6.days
), using the default configuration values instead.Easiest to review with whitespace changes hidden: https://github.com/18F/identity-idp/pull/11109/files?w=1
📜 Testing Plan
Verify that the build passes.