diff --git a/spec/support/features/datepicker_helper.rb b/spec/support/features/datepicker_helper.rb index 4244da3b99..1fb7748188 100644 --- a/spec/support/features/datepicker_helper.rb +++ b/spec/support/features/datepicker_helper.rb @@ -45,6 +45,14 @@ module Features select_date_from_datepicker(datetime) fill_in "Hour", with: datetime.strftime("%H") fill_in "Minute", with: datetime.strftime("%M") + + # Flatpickr needs time to update the time. + # Otherwise submitting the form may not work. + # CI experimentation: 10ms -> 7% success + # 50ms -> 87% success + # 100ms -> 100% success in 112 runs + # Let's double that to reduce flakiness even further. + sleep 0.2 end def pick_datetime(calendar_selector, datetime_selector)