Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4
-
None
-
-
728c03ca7 (13.0), 63b2cf8a4 (dev), 933b606af (6.7), 7f3f29b7a (6.6), 56c388000 (master)
Description
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