diff --git a/tests/slic3rutils/slic3r_jobs_tests.cpp b/tests/slic3rutils/slic3r_jobs_tests.cpp index 5dc1b8e05b..abb8b15265 100644 --- a/tests/slic3rutils/slic3r_jobs_tests.cpp +++ b/tests/slic3rutils/slic3r_jobs_tests.cpp @@ -57,11 +57,10 @@ TEMPLATE_LIST_TEST_CASE("State should not be idle while running a job", "[Jobs]" }).wait(); }); - worker.wait_for_idle(); + // make sure that the job starts BEFORE the worker.wait_for_idle() is called + std::this_thread::sleep_for(std::chrono::milliseconds(100)); - // To avoid stalling the job, in case the wait_for_idle is called before - // the job goes into blocking wait - worker.process_events(); + worker.wait_for_idle(); REQUIRE(worker.is_idle()); } @@ -79,13 +78,12 @@ TEMPLATE_LIST_TEST_CASE("Status messages should be received by the main thread d }); worker.wait_for_idle(); - worker.process_events(); REQUIRE(pri->pr == 100); REQUIRE(pri->statustxt == "Running"); } -TEMPLATE_LIST_TEST_CASE("Cancellation should be recognized by the worker", "[Jobs]", TestClasses) { +TEMPLATE_LIST_TEST_CASE("Cancellation should be recognized be the worker", "[Jobs]", TestClasses) { using namespace Slic3r; using namespace Slic3r::GUI; @@ -110,7 +108,6 @@ TEMPLATE_LIST_TEST_CASE("Cancellation should be recognized by the worker", "[Job worker.cancel(); worker.wait_for_current_job(); - worker.process_events(); REQUIRE(pri->pr != 100); } @@ -148,7 +145,6 @@ TEMPLATE_LIST_TEST_CASE("cancel_all should remove all pending jobs", "[Jobs]", T // during the first job's execution. std::this_thread::sleep_for(std::chrono::milliseconds(500)); worker.cancel_all(); - worker.process_events(); REQUIRE(jobres[0] == true); REQUIRE(jobres[1] == false); @@ -177,7 +173,5 @@ TEMPLATE_LIST_TEST_CASE("Exception should be properly forwarded to finalize()", }); worker.wait_for_idle(); - worker.process_events(); - REQUIRE(worker.is_idle()); }