From f47ddad839aa60a0ec91e6a627c5d868a69e5cf1 Mon Sep 17 00:00:00 2001 From: ScottW514 Date: Mon, 28 Sep 2026 13:49:30 -0400 Subject: [PATCH] exthost.platform: the frozen window opens once the freeze has landed The test took its first reading of the frozen probe's cpu.stat the moment cgroup.events said frozen 1, and wanted 0 us over the next 1.5 s. The kernel reports a task frozen before its last way into schedule() is charged to the group, so a reading at the event can come before that charge lands. On image 20260928170058's campaign the frozen probe was charged 16 us and the test failed. The first reading now comes 0.2 s after the event; the window and its judgment (0 us) are unchanged. Proof: pyflakes clean. On the bench reference, a spinner under cpu.max 5% in a cgroup of its own, frozen 520 times with the first reading taken both ways: read at the event (polled every 50 ms, as the test does), the next 0.5 s was charged 4 times (13 to 20 us); read after the 0.2 s settle, never. Acceptance: the change is exthost.platform itself, inside its own function, so no other test's fingerprint moves. --- forgetest/forgetest/suite/exthost.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/forgetest/forgetest/suite/exthost.py b/forgetest/forgetest/suite/exthost.py index 527fdf8..0f3f7b0 100644 --- a/forgetest/forgetest/suite/exthost.py +++ b/forgetest/forgetest/suite/exthost.py @@ -339,6 +339,9 @@ def platform(ctx): _write(PROBE_GROUP + "/cgroup.freeze", "1") ok = ctx.wait_for(lambda: _flat(PROBE_GROUP + "/cgroup.events").get("frozen") == 1, 3, poll=0.05) ctx.check(ok is not None, "the group did not freeze: %s", _flat(PROBE_GROUP + "/cgroup.events")) + # The kernel reports a task frozen before its last way into + # schedule() is charged, so the window opens once that has landed. + ctx.sleep(0.2) f0 = _flat(PROBE_GROUP + "/cpu.stat")["usage_usec"] ctx.sleep(1.5) f1 = _flat(PROBE_GROUP + "/cpu.stat")["usage_usec"]