fix(tests): give each RTC test run its own title directory #10642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10642"
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 maximilianfv on 2026-10-24T14:16:41Z.
What
guest_rtcandguest_rtc_ps5_titlerun the same binary (guest_rtc_tests). Each run makes a title directory under the temporary directory and works there;guest_rtcwrites a PS4param.sfo(CUSA00000) into it, while theps5-titlerun expects no title file and so applies the PS5 range rules (ps4Title()inlibSceRtc/Export.cppreads the title id fromapp0/sce_sys/param.sfoin the working directory).EnterTitleDirectorynamed that directory afterstd::chrono::steady_clock::now(). Whenctest -jstarts both tests at once they can read the same value and share one directory; the PS5 run then reads the PS4 title, applies the PS4 rules and aborts. This names the directory withstd::random_device, as the other tests that make temporary directories do (GuestAppIcon.cpp,GuestEntitlements.cpp,CpuTopology.cpp).<chrono>had no other use in the file and is dropped. Test-only change.The
ps5-titlemode and the title directory came in with2120035611(ntamas94).Tested
Apple M1 Pro, macOS 27.0.1, x86_64 build under Rosetta 2, in a tree made of mugurc's macOS series (
ci/macos-series-2,27e968974) merged withmainat522e32e3b6, plus other open macOS fixes, toggling only this change.ctest -j4run,guest_rtc_ps5_titleaborted whileguest_rtcran beside it; alone it passes 5 of 5.guest_rtc_testsandguest_rtc_tests ps5-titletogether 200 times: theps5-titlerun failed 64 times without this change and 0 times with it.rtc-test-*directories instead of 100, with exactly 9 failures, so each failure was a shared directory.ps5-titlestarted beside itself (it writes noparam.sfo) failed 0 of 100 times.steady_clockadvances in 83 ns steps on this machine.ctest -R '^guest_rtc'passes (2 tests).Not tested on Linux or Windows; the race only needs two runs that read the same clock value, so any parallel
ctestcan hit it.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:19:14Z.
Review: APPROVED
Reviewed exact head
28f3f43842. The previous steady-clock value could collide when parallel processes create their temporary title directories; usingstd::random_devicematches the established unique-temp-path pattern already used by several guest tests in this repository. The removed<chrono>include had no remaining use in this file. Hosted eligibility, conventions, intake and labels pass; product tests were skipped, and I have not independently run the reported 200-pair race reproduction. No blocking issue found in this focused test-only change.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T04:55:32Z.
Review: APPROVED
Reviewed head
28f3f438427d920c7ccc451adfc004ed0ced4f7dagainst5ed5427bace6512fec69caa706874e4c847f8865: approve. No actionable findings in this fixture-only change.The patch replaces the timestamp-derived temporary directory suffix with random_device and adjusts the includes. Both title modes still create and enter their own fixture directory before RTC use; metadata-writing behavior remains consistent with their callers.
Validation: head and baseline GuestRtc.cpp passed GCC syntax checks. A compiled Windows fixture using the exact changed EnterTitleDirectory helper ran 100 invocations alternating a title ID and nullptr, verified distinct observed directories, and checked that only the title-ID mode created param.sfo. This observation is not a mathematical uniqueness guarantee. Conventions, whitespace and test registration passed. The full RTC executable and pinned production library were not built or run; hosted native jobs were skipped. Approval is scoped to the directory-name change.