tst_QPromise: don't wait() indefinitely
In unit-tests, blocking operations should be timed, whenever possible, so that a proper failure is logged instead of a watchdog timeout (which is reported as a crash). Wait for 60s and wrap the wait() in QVERIFY(). Since this can fail, mark ThreadWrapper's dtor as non-noexcept. Amends 385f0732d927f0eba8ecf990ee9bc19936475edd. Pick-to: 6.8 6.5 6.2 Change-Id: I3462017cb1a7580c901b98e9b1c3741853f32dc6 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
parent
9965f9a191
commit
32d12c2eba
@ -96,10 +96,10 @@ struct ThreadWrapper
|
|||||||
{
|
{
|
||||||
t->start();
|
t->start();
|
||||||
}
|
}
|
||||||
void join() { t->wait(); }
|
void join() { QVERIFY(t->wait(60s)); }
|
||||||
~ThreadWrapper()
|
~ThreadWrapper() noexcept(false)
|
||||||
{
|
{
|
||||||
t->wait();
|
join();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user