From 1b063e1dea8d73703d37e4469b2826c48c8d1583 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Oct 2019 11:43:53 +0200 Subject: [PATCH] Add a delay before calling wxDateTime::UNow() again in the test Retrying immediately wasn't very useful, as the times must have been the same during all loop iterations anyhow, so add a sleep to try to finally fix the sporadic test failure on Travis. --- tests/datetime/datetimetest.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index 7f33c2370c..6c9af98035 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -20,6 +20,7 @@ #ifndef WX_PRECOMP #include "wx/time.h" // wxGetTimeZone() + #include "wx/utils.h" // wxMilliSleep() #endif // WX_PRECOMP #include "wx/wxcrt.h" // for wxStrstr() @@ -1715,7 +1716,11 @@ TEST_CASE("wxDateTime::UNow", "[datetime][now][unow]") break; WARN("wxDateTime::Now() and UNow() returned different " - "second values, retrying."); + "second values (" + << now.GetSecond() << " and " << unow.GetSecond() << + "), retrying."); + + wxMilliSleep(123); } CHECK( now.GetYear() == unow.GetYear() );