Stabilize tst_Picking by waiting for a rendered frame
tst_Picking::test_view_picking, test_ray_picking and
test_closest_point_picking each toggle an embedded Item2D's enabled or
visible state and then exercise the picking API. They previously used
QTest::qWait(100) to let the change take effect, which was occasionally
too short on slower CI machines (recently observed as a deterministic
failure on macos-14-arm64): the Item2D state change had not yet been
synced to the scene-graph copy used by picking by the time the next
pick() call ran.
Extract the frameSwapped wait that QQuick3DDataTest::grab() was
already doing into a reusable QQuick3DDataTest::waitForFrames() helper
and replace the six QTest::qWait(100) call sites in tst_picking with
waitForFrames(view.data(), 1). One full frame swap is sufficient
because the Item2D state propagates to picking during the sync phase
of the next render cycle.
Pick-to: 6.11
Change-Id: Ib46e262d81edd69757c24b97fb4ebfe11033aa08
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>