Conversation
there is a disconnect with redis and the rate limiter causing the tests to be flaky if you use a 1 second difference. I also changed the verify_info_step spec to check if the user is not rate limited since it would have expired.
changelog: Internal, IdV Tests, Fix flaky verify info spec test
| complete_verify_step | ||
|
|
||
| expect(page).to have_current_path(idv_phone_path) | ||
| expect(RateLimiter.new(user: user, rate_limit_type: :idv_resolution)).to be_limited |
There was a problem hiding this comment.
I'm confused why we expected it to be limited, if it's outside of the window, it should have been not limited right?
There was a problem hiding this comment.
Yeah. As best we can figure, this has been wrong for a bit; the other changes made the incorrect test usually pass. This started as a flaky-spec (this one) investigation, and it turned out that the occasional failure was the proper behavior. The problem was confined to the spec, and the duplicate calls to the before action were masking it.
| complete_verify_step | ||
|
|
||
| expect(page).to have_current_path(idv_phone_path) | ||
| expect(RateLimiter.new(user: user, rate_limit_type: :idv_resolution)).to be_limited |
There was a problem hiding this comment.
Yeah. As best we can figure, this has been wrong for a bit; the other changes made the incorrect test usually pass. This started as a flaky-spec (this one) investigation, and it turned out that the occasional failure was the proper behavior. The problem was confined to the spec, and the duplicate calls to the before action were masking it.
🎫 Ticket
Link to the relevant ticket:
LG-11624
🛠 Summary of changes
Fixed a flaky test that would fail if the 1 second difference between redis and the test happened. Also changed the assertion for the user to be not rate limited rather than be limited.
📜 Testing Plan
Provide a checklist of steps to confirm the changes.
verify_info_step_spec.rbpasses.