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 testing these values.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=54498 --- dlls/kernel32/tests/heap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 24ce6b792da..ec5f074cf85 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,7 @@ START_TEST(heap) test_LocalAlloc();
test_GetPhysicallyInstalledSystemMemory(); - test_GlobalMemoryStatus(); + LOOP_ON_FLAKY_TESTS(3) test_GlobalMemoryStatus();
if (pRtlGetNtGlobalFlags) {