test(libkernel): wait until 50 ms have passed before the first process time read #3414
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3414"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T09:52:55Z.
What
Follow-up to #3368, which @orishamir found flaky on Windows (comment on #3368): under parallel load,
guest_process_time_counteroccasionally fails withThe test slept 50 ms with
std::this_thread::sleep_forand then required the first reading to include 50 ms. On Windows that sleep can return slightly early when measured against the performance counter the guest clock reads (TimedWait::NowNanos, QPC), so the reading could come out just under 50 ms. The fix itself is fine: the start is captured at load. Only the test's wait was imprecise.The test now waits until
std::chrono::steady_clockreports 50 ms have passed, looping onsleep_until, before the first call. The process start precedes that point, so the first reading includes at least 50 ms (scaled for the_scaledvariants).Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release, on
maina73a1af9:ctest -R "^guest_process_time" --repeat until-fail:60 -j8:main,guest_process_timeandguest_process_time_counter_scaledfailed with0xc0000409within the 60 rounds;check_conventions.pypasses, andpr_overlap.pyreports no overlap.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-11T10:11:49Z.
Verified on the machine that saw the flake: Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
0eaf2ec1merged ontomain434f290d(clean).guest_process_time_counterpasses 20/20 and the fourguest_process_time*tests 5/5 each; the one failure I had seen was in a full--parallel 4run, so the repeats here were serial, which is the easier case, but the loop onsleep_untilremoves the early-return the old 50 mssleep_forallowed.AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:12:41Z.
Checked the diff (test-only, waits on
steady_clockbefore the first read, so the process start precedes it) and ranguest_process_time*10 rounds on Linux, all pass; Conventions green. The Windows fix rests on your 60-round-j8run; merging.