From: Francois Gouget <fgouget(a)codeweavers.com> If other processes allocate or free enough memory (e.g. by terminating), the available physical memory and swap space reported by the system may change while we are testing these values. Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=54498 --- dlls/kernel32/tests/heap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 24ce6b792da..c9e4aefd4ec 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -3624,9 +3624,11 @@ static void test_GlobalMemoryStatus(void) ok( memex.dwMemoryLoad == expect.dwMemoryLoad, "got dwMemoryLoad %lu\n", memex.dwMemoryLoad ); ok( memex.ullTotalPhys == expect.ullTotalPhys, "got ullTotalPhys %#I64x\n", memex.ullTotalPhys ); - ok( IS_WITHIN_RANGE( memex.ullAvailPhys, expect.ullAvailPhys ), "got ullAvailPhys %#I64x\n", memex.ullAvailPhys ); + /* ullAvailPhys may change if a big process starts / stops */ + tryok( IS_WITHIN_RANGE( memex.ullAvailPhys, expect.ullAvailPhys ), "got ullAvailPhys %#I64x\n", memex.ullAvailPhys ); ok( memex.ullTotalPageFile == expect.ullTotalPageFile, "got ullTotalPageFile %#I64x\n", memex.ullTotalPageFile ); - ok( IS_WITHIN_RANGE( memex.ullAvailPageFile, expect.ullAvailPageFile ), "got ullAvailPageFile %#I64x\n", memex.ullAvailPageFile ); + /* ullAvailPageFile may change if a big process starts / stops */ + tryok( IS_WITHIN_RANGE( memex.ullAvailPageFile, expect.ullAvailPageFile ), "got ullAvailPageFile %#I64x\n", memex.ullAvailPageFile ); ok( memex.ullTotalVirtual == expect.ullTotalVirtual, "got ullTotalVirtual %#I64x\n", memex.ullTotalVirtual ); ok( memex.ullAvailVirtual <= expect.ullAvailVirtual, "got ullAvailVirtual %#I64x\n", memex.ullAvailVirtual ); ok( memex.ullAvailExtendedVirtual == 0, "got ullAvailExtendedVirtual %#I64x\n", memex.ullAvailExtendedVirtual ); @@ -3749,7 +3751,9 @@ START_TEST(heap) test_LocalAlloc(); test_GetPhysicallyInstalledSystemMemory(); - test_GlobalMemoryStatus(); + + /* The system memory usage may change during the test */ + LOOP_ON_FLAKY_TESTS(3) test_GlobalMemoryStatus(); if (pRtlGetNtGlobalFlags) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3418