diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-11-01 11:59:10 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-11-03 15:18:35 -0700 |
| commit | 2bce75a6b53cccbf9c813581b64eea87f3ab55fc (patch) | |
| tree | aa30ca487825a2f66119230f22ab9dedd8db5a0e /tests/auto/sql/kernel/qsqldatabase/tst_databases.h | |
| parent | 91d16c852bac4ad09320dd487632634b50d636d5 (diff) | |
tst_QThread: improve test on multiple threads waiting on wait()
Amends commit 5b5297fe87859f59a7aaf5e86a8915c00714fefa to make it more
reliable against CI timeouts and flakiness. Now, we wait for the threads
that are expected to timeout to actually timeout before releasing the
target thread they were waiting on. It should be impossible now for this
to go wrong. There should also be no problem of their handing off to a
thread that will wait forever.
I've added two more tests that could, possibly, have a problem in the
CI: when timing-out threads hand off to a timed wait that is expected to
succeed (the > 1s wait cases). Though this should be a rare occurrence,
if ever: the target thread's runtime is the longest of the timing out
threads' wait, plus 5 ms. That is 30 ms in the examples I wrote, so the
additional extra time they're waiting on should be more than enough.
An extra benefit is that this test now runs much faster, at 10 to 60 ms
per test row, instead of 800 ms previously. The drawback is that a
failure condition is likely going to be noticed by the QSemaphores
deadlocking.
Change-Id: I360d7e9c7accc1216291fffd743c88a362cf66ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/sql/kernel/qsqldatabase/tst_databases.h')
0 files changed, 0 insertions, 0 deletions
