I think the general pattern is that WPushButtonTest calls qWait which runs the Qt event loop, processing events that have been queued from other tests. Here's an example where GlobalTrackCache::~GlobalTrackCache is run from a deleteLater event: [ RUN ] WPushButtonTest.QuickPressNoLatchTest Loading resources from "/home/rryan/Code/mixxx/res/" ControlDoublePrivate::getControl returning NULL for ( "[Controls]" , "touch_shift" ) ControlDoublePrivate::getControl returning NULL for ( "[Controls]" , "touch_shift" ) ControlDoublePrivate::getControl returning NULL for ( "[Master]" , "num_decks" ) Thread 1 "mixxx-test" received signal SIGSEGV, Segmentation fault. 0x0000000000a8ed0c in std::_Sp_counted_deleter, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (this=0x1a16660) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:466 466 { _M_impl._M_del()(_M_impl._M_ptr); } (gdb) bt #0 0x0000000000a8ed0c in std::_Sp_counted_deleter, (__gnu_cxx::_Lock_policy)2>::_M_dispose() (this=0x1a16660) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:466 #1 0x000000000050e3e5 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x1a16660) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:150 #2 0x000000000050e39a in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7fffffffd5b0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:659 #3 0x00000000005d39a9 in std::__shared_ptr::~__shared_ptr (this=0x7fffffffd5a8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:925 #4 0x0000000000cbd326 in std::__shared_ptr::reset (this=0x1a88078) at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/shared_ptr_base.h:1022 #5 0x0000000000cb79f4 in GlobalTrackCache::deactivate (this=0x1a88060) at src/track/globaltrackcache.cpp:349 #6 0x0000000000cba7b6 in GlobalTrackCache::~GlobalTrackCache (this=0x1a88060) at src/track/globaltrackcache.cpp:259 #7 0x0000000000cba889 in GlobalTrackCache::~GlobalTrackCache (this=0x1a88060) at src/track/globaltrackcache.cpp:258 #8 0x00007ffff5978c20 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 #9 0x00007ffff62ba05c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 #10 0x00007ffff62bf516 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 #11 0x00007ffff594938b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 #12 0x00007ffff594b786 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 #13 0x0000000000ca0e7d in QTest::qWait (ms=1) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qtestsystem.h:59 #14 0x0000000000ca0698 in QTest::mouseEvent (action=QTest::MouseRelease, widget=0x18f77c0, button=Qt::LeftButton, stateKey=..., pos=..., delay=1) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qtestmouse.h:161 #15 0x0000000000ca1f6f in QTestMouseEvent::simulate (this=0xcebfa90, w=0x18f77c0) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qtestevent.h:127 #16 0x0000000000ca11a5 in QTestEventList::simulate (this=0xcf220e0, w=0x18f77c0) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qtestevent.h:211 #17 0x0000000000c9fc8e in WPushButtonTest_QuickPressNoLatchTest_Test::TestBody (this=0xcf220b0) at src/test/wpushbutton_test.cpp:50 #18 0x0000000000e19caa in testing::internal::HandleSehExceptionsInMethodIfSupported (object=0xcf220b0, method=&virtual testing::Test::TestBody(), location=0x11c1c84 "the test body") at lib/gtest-1.7.0/src/gtest.cc:2078 #19 0x0000000000e0aac7 in testing::internal::HandleExceptionsInMethodIfSupported (object=0xcf220b0, method=&virtual testing::Test::TestBody(), location=0x11c1c84 "the test body") at lib/gtest-1.7.0/src/gtest.cc:2114 #20 0x0000000000df31d5 in testing::Test::Run (this=0xcf220b0) at lib/gtest-1.7.0/src/gtest.cc:2150 #21 0x0000000000df3e98 in testing::TestInfo::Run (this=0x1892aa0) at lib/gtest-1.7.0/src/gtest.cc:2326 #22 0x0000000000df4557 in testing::TestCase::Run (this=0x1892bd0) at lib/gtest-1.7.0/src/gtest.cc:2444 #23 0x0000000000dfbd11 in testing::internal::UnitTestImpl::RunAllTests (this=0x185fe40) at lib/gtest-1.7.0/src/gtest.cc:4315 #24 0x0000000000e1d28a in testing::internal::HandleSehExceptionsInMethodIfSupported (object=0x185fe40, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0xdfba30 , location=0x11c2362 "auxiliary test code (environments or event listeners)") at lib/gtest-1.7.0/src/gtest.cc:2078 #25 0x0000000000e0ce77 in testing::internal::HandleExceptionsInMethodIfSupported (object=0x185fe40, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0xdfba30 , location=0x11c2362 "auxiliary test code (environments or event listeners)") at lib/gtest-1.7.0/src/gtest.cc:2114 #26 0x0000000000dfb9e3 in testing::UnitTest::Run (this=0x179c730 ) at lib/gtest-1.7.0/src/gtest.cc:3926 #27 0x0000000000bd2fb1 in RUN_ALL_TESTS () at lib/gtest-1.7.0/include/gtest/gtest.h:2288 #28 0x0000000000bd2f5e in main (argc=1, argv=0x7fffffffe688) at src/test/main.cpp:33 (gdb)