From: Luca Boccassi Date: Tue, 5 May 2026 14:33:49 +0000 (+0100) Subject: test-oomd: fix flakiness under sanitizers X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0aa351ba966bb89bab11673cae72ccba2e16bc4;p=thirdparty%2Fsystemd.git test-oomd: fix flakiness under sanitizers The test asserts that pgscan is 0, but under sanitizers this sometimes fails and shows up as 1. We cannot control what the kernel scans, and with sanitizers the runtime can be slow enough it's possible that the kernel does a pass on the cgroup of the unit test. Instead of asserting that it's 0, assert that it's between 0 and 9, which seems a reasonable range. Fixes https://github.com/systemd/systemd/issues/37710 --- diff --git a/src/oom/test-oomd-util.c b/src/oom/test-oomd-util.c index 7332f532a8a..c78315c56b6 100644 --- a/src/oom/test-oomd-util.c +++ b/src/oom/test-oomd-util.c @@ -291,7 +291,7 @@ TEST(oomd_cgroup_context_acquire_and_insert) { ASSERT_EQ(ctx->memory_low, 0u); ASSERT_EQ(ctx->swap_usage, 0u); ASSERT_EQ(ctx->last_pgscan, 0u); - ASSERT_EQ(ctx->pgscan, 0u); + ASSERT_LT(ctx->pgscan, 10u); ASSERT_NULL(ctx = oomd_cgroup_context_unref(ctx)); ASSERT_OK(oomd_cgroup_context_acquire("", &ctx));