mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-24 15:27:41 +08:00
test_multiple_semaphores_waiting() spawns a worker thread per TestCase, then advances virtual time in a loop and completes each case in check(). Since check() early-returns while !_thread_ready, a slow-to-start worker thread can miss the whole loop: the loop advances past the case's timeout before the thread registers, so the case is never completed. ~TestCase() then fails EXPECT_TRUE(_is_done) and destroys a still-joinable std::thread, which calls std::terminate() and aborts the test. This was flaky (~50% locally, worse under CI load). Wait for every worker thread to be ready before advancing virtual time. Also re-comment the per-iteration std::cout that was left enabled. Signed-off-by: Julian Oes <julian@oes.ch>