fix(tests): let the TZ flipper of the zone race yield #8288
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8288"
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 mugurc on 2026-10-20T09:00:53Z.
What
guest_time_conversion(#6916) times out on macOS. Its zone race changes TZ in a tight loop while six threads convert times, and on macOS the flipper keeps the guest environment lock: the default mutex there lets the thread that unlocks take the lock again before a woken waiter runs. The readers spend their time waiting on the zone and environment locks, and the test runs for 21 seconds, past its 20-second timeout. Part of the macOS series announced on #1 (https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6124344298).The flipper now yields after each change. The readers still see TZ change under them all the time, so the race checks the same thing, and the test takes about a second on macOS.
Tested
macOS 26.5.1, Apple M5 Max, Apple clang 21, x86-64 build under Rosetta 2. The libraries do not link on macOS without the rest of the macOS series, so the run is on
main3fd1cc393with the series (ci/macos-series-2on my fork), #8279, #8284, #8287, the open macOS fixes #7524 and #7937, and three changes from #7332.sampleprofile of the test: the readers spend about 90% of their samples waiting, inZoneScopeon the zone lock or inCopyGuestEnvironment_nid_no_patchon the environment lock. The flipper spends nearly half of its samples waking waiters when it unlocks.localtime_scalls, and the run took 39 seconds. With the yield, it changes TZ about 800,000 times, and the readers get each of the two offsets in about half of their calls, over three runs (7,427/7,573, 7,472/7,528 and 7,522/7,478). No conversion was torn in any run.guest_time_conversionpasses 5 runs of 5 under its 20-second timeout, in 0.5 to 1.3 seconds.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T06:58:36Z.
Windows run of
070e44768cmerged ontomainec7eacc62d(95c21ccdb0, clean), one of the hosts the description lists as not run. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
guest_time_conversion_testswith no errors or warnings;ctest --repeat until-fail:2onguest_time_conversion: passes on both repeats. Not run: Linux.