Fix tst_UpdateSpatialNode::updateResource race on destroy count


The test uses QQuick3DDataTest::grab(), whose shared utility now calls
window->update() and waits for QQuickWindow::frameSwapped before
invoking grabWindow(). This drives QSSGRenderNode update cycles earlier
and with less implicit event-loop spinning in the test body, exposing a
pre-existing race between the main thread and the render thread.

Backend node deletion is dispatched via cleanupResources(), which is
connected to QQuickWindow::afterFrameEnd with Qt::DirectConnection and
therefore runs on the render thread. afterFrameEnd fires after the render
phase of a frame, which can be concurrent with the main thread exiting
the QTRY_VERIFY(callCount == 3) loop that exits as soon as callCount is
set during the sync phase of the same frame. The result is that
destroyedCount may still be 0 when QCOMPARE evaluates it.

Replace QCOMPARE with QTRY_COMPARE for all three destroyedCount checks
so the test correctly waits for the asynchronous render-thread deletion
to complete rather than relying on incidental event-loop timing.

Pick-to: 6.11
Change-Id: I4d8fc89fb1dfd846427253d7819c0aff60a7d5ee
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
commita7b4f3f661ee86090beb069e78fe5745cb4a6c20
parenta007652ba83dd185f583b0c77f658203a55d908f
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeTue, 26 May 2026 09:50:24 +0000