From 5f0af2495b4faa89a2cfcd76b1eab796b6639ce2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 22 Aug 2017 20:07:33 +0200 Subject: [PATCH] Test-Fix: possible race in test setup On rare occasions, the test thread itself consumes faster than the producer threads feed new test data. Make sure the test does not hangin such a situation --- tests/gui/bus-term-test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/gui/bus-term-test.cpp b/tests/gui/bus-term-test.cpp index 32b45a4d2..e94b6fbcb 100644 --- a/tests/gui/bus-term-test.cpp +++ b/tests/gui/bus-term-test.cpp @@ -722,6 +722,13 @@ namespace test { session.join(); //------end-multithreaded-mutation--- + // on rare occasions we (consumer thread) + // prematurely empty the queue... + while (not isnil(uiDispatcher)) + { + uiDispatcher.invoke(); + } + // now verify rootMock has been properly assimilated... uint generatedBorgs = rootMock.scope.size();