-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4
-
None
-
-
728c03ca7 (13.0), 63b2cf8a4 (dev), 933b606af (6.7), 7f3f29b7a (6.6), 56c388000 (master)
Consider this test:
QObject context;
QFuture<QString> f = run([](QPromise<QString> &fi) {
fi.addResult("First");
fi.addResult("Second");
});
int count = 0;
QString res;
QFutureWatcher<QString> watcher;
connect(&watcher, &QFutureWatcherBase::resultReadyAt,
&context, [&watcher, &count, &res](int index) {
++count;
res = watcher.future().resultAt(index);
});
watcher.setFuture(f);
f.waitForFinished();
QCoreApplication::processEvents();
QCOMPARE(count, 2);
QCOMPARE(res, QString("Second"));
It sometimes fails with:
Actual (res) : "First" Expected (QString("Second")): "Second"
Please see: https://codereview.qt-project.org/c/qt/qtbase/+/518638. The test fails on some platforms in CI.
Spotted originally on MacOS MacOS_11 (clang-x86_64): https://testresults.qt.io/coin/integration/qt-creator/qt-creator/tasks/1704251436
| For Gerrit Dashboard: QTBUG-119169 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 518638,13 | QFutureWatcher: Fix race for initial emission of resultReadyAt() | dev | qt/qtbase | Status: MERGED | +2 | 0 |
| 534965,12 | Async: Disable onResultReady test | 13.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
| 535642,1 | Async: Disable onResultReady test | master | qt-creator/qt-creator | Status: ABANDONED | 0 | 0 |
| 548240,2 | QFutureWatcher: Fix race for initial emission of resultReadyAt() | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
| 548399,4 | QFutureWatcher: Fix race for initial emission of resultReadyAt() | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
| 554464,3 | Async: Re-enable onResultReady tests | master | qt-creator/qt-creator | Status: MERGED | +2 | +1 |