From: Francois Gouget fgouget@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 59a82c0c579..003c30d5f00 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -3595,9 +3595,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 ); @@ -3720,7 +3722,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) {