diff --git a/components/streams/test/recsend_unit.cpp b/components/streams/test/recsend_unit.cpp index 10bd7dd46e8a7e2b4bcdca1db5f1b36af04117dd..a73ef6a0a57e351418c262a650af6de930a5318d 100644 --- a/components/streams/test/recsend_unit.cpp +++ b/components/streams/test/recsend_unit.cpp @@ -210,11 +210,13 @@ TEST_CASE( "Multi-thread stability testing" ) { auto h = receiver->onFrameSet([&count,&result](const ftl::data::FrameSetPtr &fs) { LOG(INFO) << "FS RECV: " << fs->timestamp(); count++; - if (result) REQUIRE( result->timestamp() <= fs->timestamp()-20 ); - REQUIRE( fs->frames.size() == 2 ); - REQUIRE( fs->isComplete() ); - REQUIRE( fs->frames[0].hasChannel(Channel::Colour) ); - REQUIRE( fs->frames[1].hasChannel(Channel::Colour) ); + if (result) { + REQUIRE( result->timestamp() <= fs->timestamp()-20 ); + REQUIRE( fs->frames.size() == 2 ); + REQUIRE( fs->isComplete() ); + REQUIRE( fs->frames[0].hasChannel(Channel::Colour) ); + REQUIRE( fs->frames[1].hasChannel(Channel::Colour) ); + } result = fs; return true; }); @@ -269,6 +271,8 @@ TEST_CASE( "Multi-thread stability testing" ) { ftl::timer::reset(); ftl::timer::setInterval(50); + ftl::pool.clear_queue(); + while (ftl::pool.n_idle() != ftl::pool.size()) std::this_thread::sleep_for(std::chrono::milliseconds(10)); delete receiver; delete sender;