Files
wxWidgets/tests/thread
Vadim Zeitlin 996852f58b Fix crash in wxThread unit test
Wait for the threads to terminate before finishing the test and exiting
as they could be still running when it exits otherwise, resulting in
crashes in this test case, as happened in a recent CI run:

--------------------------------- >8 --------------------------------------
test 812
        Start 812: MiscThread::ThreadConditions

812: Test command: /home/runner/work/wxWidgets/wxWidgets/build_cmake/lib/test_base "MiscThread::ThreadConditions"
812: Working Directory: /home/runner/work/wxWidgets/wxWidgets/build_cmake/lib/
812: Test timeout computed to be: 10000000
812: Test program for wxWidgets non-GUI features
812: build: 3.3.4 (wchar_t,compiler with C++ ABI compatible with gcc 4,STL containers,compatible with 3.2)
812: compiled using gcc 11.4
812: running under Ubuntu 22.04.5 LTS (Jammy Jellyfish), based on debian (jammy), Linux 6.8.0-1064-azure x86_64 as runner
812: Filters: MiscThread::ThreadConditions
812: ===============================================================================
812: All tests passed (32 assertions in 1 test case)
812:
812: malloc_consolidate(): unaligned fastbin chunk detected
812/871 Test #812: MiscThread::ThreadConditions .........................Subprocess aborted***Exception:   0.84 sec
--------------------------------- >8 --------------------------------------

This crash was difficult to reproduce and only became visible in the CI
after the recent changes resulting in running all the tests in parallel
as this starved this test from having enough cores to mask it. To
reproduce it locally "taskset -c 0 ./test MiscThread::ThreadConditions"
had to be used, this allows to reproduce it under TSAN after just a few
iterations while without taskset it passed 100 times out of 100.
2026-09-11 00:58:18 +02:00
..
2026-09-11 00:58:18 +02:00
2025-09-08 06:37:15 -04:00