Skip to content

Resolve flaky spec in spec/features/users/signup_spec.rb

Roy Liu requested to merge 428680-fix-flaky-features-spec-users-signup_spec into master

What does this MR do and why?

The root cause of the original flaky spec is: it is trying to test that when form submitted quicker than the timestamp_threshold, which is 4 seconds, sign-up is blocked.

But we have changed the sign-up form fill in helper to wait for various kinds of requests and validation to complete before submitting to reduce flakiness in other specs, so it is possible that the wait exceeds 4 second, hence invisible_captcha deems the form submission is valid, does not prevent the sign-up.

This MR adds freeze_time to the spec to fix that, plus added the test for when honeypot field is filled in to cover the full use cases of invisible_captcha.

How to set up and validate locally

Add sleep 4 after this line to simulate form filled and submitted slower than 4 seconds.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #428680 (closed)

Edited by Roy Liu

Merge request reports

Loading