diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index 80907c9f03..4beb91becb 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -662,10 +662,10 @@ TEST_CASE_METHOD(GridTestCase, "Grid::SortClick", "[grid]") wxYield(); sim.MouseClick(); - WaitFor("mouse click to be processed", [&]() { - return sort.GetCount() != 0; - }); - + if ( !WaitForEventAt(pos, "mouse click to be processed", [&]() { + return sort.GetCount() != 0; + }) ) + return; CHECK(sort.GetCount() == 1); #endif }