From c1f8d3035a22ff19a62e4235fad5c2abb7c48569 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 19 Dec 2024 16:39:49 +1100 Subject: [PATCH] Sleep after selecting time for stability --- spec/support/features/datepicker_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) 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)