test(libkernel): initialize UTC for timezone assertion #12809
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12809"
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 Sean09898 on 2026-10-29T10:15:19Z.
Initialize UTC explicitly before the kernel timezone assertion to remove its dependency on the host timezone.
The test previously failed on Australia/Brisbane but passed when TZ=UTC0 was specified.
Validation:
Development and debugging were AI-assisted; the resulting change was validated locally.
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T10:26:17Z.
Review: COMMENTED
I checked this on the host only (macOS arm64, clang ASan+UBSan). I didn't build
guest_freebsd_clocks.Harness. I copied
HostZoneAt/HostDaylightAmountverbatim fromTime.cppL765-802 on mainbc3e33f4e3(POSIX branch) and computed the twosceKernelGettimezonevalues from them the same way L847 does. Then I ran theKernelTimezoneIsUtcassertion with and without this PR'sSetTimeZone("UTC0"):TZUTC0, emptyAustralia/BrisbaneAmerica/New_York,Europe/London,Asia/Kolkata,Etc/GMT+12/etc/localtime= Europe/London)So the failure in your report is real. On main the result depends on the zone of the machine running the test, because this check runs first in
main(), before anything callsSetTimeZone. With your line it passes in every zone I tried.Overlap.
pr_overlap --branchreports a conflict with #12660 (JJenkx, opened earlier today, one review). That PR deletesKernelTimezoneIsUtcfor the same reason. The two PRs are alternative fixes for one bug, and only one of them should merge. I'd go with deleting the check. With UTC forced, it tests nothing thatTimezoneReportsTheStandardOffsetAndDaylightAmountdoesn't already cover:RequireTimezone("UTC0", 0, 0)at L304, and the null-pointer0x8002000erow at L309. Also, the nameKernelTimezoneIsUtcno longer describes the behaviour sincefabe448517changedsceKernelGettimezoneto report the host zone (debtlibkernel.mdL42).Checks:
git merge-treevs main is clean andcheck_conventions --headpasses. CI here only ran intake (the build lanes were skipped).Pull request closed