From: Stefan Dösinger stefan@codeweavers.com
The issue can be reproduced with LIBGL_ALWAYS_SOFTWARE=1 on Mesa. The Gitlab machines are affected. --- dlls/d3d9/tests/device.c | 4 +++- dlls/d3d9/tests/utils.h | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 2948d030d12..01a3023c8bf 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -6625,7 +6625,9 @@ static void test_occlusion_query(void)
hr = IDirect3DDevice9_BeginScene(device); ok(hr == D3D_OK, "Failed to begin scene, hr %#lx.\n", hr); - for (i = 0; i < 50000; ++i) + /* This loop can take some time on Mesa's software renderer. Don't push + * it too high or it might time out on Gitlab CI. */ + for (i = 0; i < 30000; ++i) { hr = IDirect3DQuery9_Issue(query, D3DISSUE_BEGIN); ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); diff --git a/dlls/d3d9/tests/utils.h b/dlls/d3d9/tests/utils.h index 248e07eb521..9b932df4ef9 100644 --- a/dlls/d3d9/tests/utils.h +++ b/dlls/d3d9/tests/utils.h @@ -27,12 +27,21 @@ static inline void wait_query_(const char *file, unsigned int line, IDirect3DQue unsigned int i; HRESULT hr;
- for (i = 0; i < 500; ++i) + /* Some of the larger loops in test_occlusion_query() can take quite some time on + * software Mesa (i.e., the gitlab CI machines). */ + for (i = 0; i < 1000; ++i) { if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) == S_OK) break; Sleep(10); } + + if (hr == S_OK) + { + todo_wine_if (i >= 500) + ok_(file, line)(i < 500, "Query took %u ms to finish.\n", i * 10); + } + ok_(file, line)(hr == S_OK, "Got unexpected hr %#lx.\n", hr); }