tests: accept a heartbeat peak commit that rose between samples #2559
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2567"
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 R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T21:16:02Z.
Part of #448
What this unblocks:
startup_heartbeat_commitstops failing on Windows when the process peak commit rises between two heartbeat samples, and it runs in about 3 s instead of about 30 s.Change:
tests/startup_heartbeat_check.py: after the extra allocation is freed, the check required the later sample's peak to be exactly equal to the earlier one. A peak can only stay or grow, and the heartbeat thread or the allocator can raise it between samples, so the exact match fails on a healthy run. It now requires>=; a peak that falls is still a failure, and the commit must still drop by at least 8 MiB. The rule lives inreleased_is_valid(), and a newcontrols()step (run first, also alone asstartup_heartbeat_check.py controls) is the negative control: equal peak passes, a raised peak passes, a fallen peak fails, a commit that dropped under 8 MiB fails.Sleep(10000)insrc/startup_stubs/xcrdapi.cpp). The heartbeat thread now readsX2W_HEARTBEAT_INTERVAL_MS(a whole number from 1000 to 10000; anything else keeps 10000), and the test sets 1000. A test-only knob in the DLL is needed because the interval is a compiled-in sleep inside the stub that the test launches; the test cannot shorten it from outside. The log label stays whole seconds. The test also asserts the first sample is labelled under 10 s, so it fails if the override stops working.startup_storage_worker_start. Measured on Win2025 it gave no gain (37.5 s with the old 5 ms sleeps, 37.1 to 40.4 s with 1 ms), so it is not in this PR.Verification (Win2025, exact head
1761adc4e50e4d758f9d2142a9eb9ed4a77317cd, three separate runs, dev + release each, so 6 passes of the test with the 1 s interval):cmake --build --preset dev --target startup_stub_xcrdapi -- -j 2-> ok (0.41 s)ctest --preset dev -R 'startup_heartbeat' --parallel 2 --no-tests=error --output-on-failure-> 1/1 passed,startup_heartbeat_commit3.14 s, 3.40 s, 3.52 scmake --build --preset release --target startup_stub_xcrdapi -- -j 2-> ok (3.30 s)ctest --preset release -R 'startup_heartbeat' --parallel 2 --no-tests=error --output-on-failure-> 1/1 passed, 3.16 s, 3.13 s, 3.10 scontrols()step runs inside that ctest test, so the negative control passed on each run.git diff --check-> cleanAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T22:48:56Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
1761adcℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.