Skip to content

test: Desktop deadline checks no longer race CI scheduling - #105448

Merged
teknium1 merged 1 commit into
mainfrom
fix/desktop-reap-budget-clock
Sep 8, 2026
Merged

teknium1 merged 1 commit into
mainfrom
fix/desktop-reap-budget-clock

Conversation

@teknium1

@teknium1 teknium1 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Desktop orphan-reap deadline tests no longer race CI scheduling before their first record.

  • Freeze each existing budget fixture's clock until its first identity probe completes, then advance to the exact deadline; always restore the clock on test completion.
  • Retain both invariants: confirmed PID mismatches are discarded, confirmed orphans are stopped, and unprocessed records survive budget exhaustion.
  • Add an opt-in scheduling-pressure replay under evals/; production code and deadline behavior are unchanged.

Root cause: the fixtures allowed only 1 ms of real time before the first iteration, so a scheduling pause correctly preserved both records instead of processing the first.

Live repro: scheduling-controlled execution of the real ownership module on base 2237be355906fbe6065ce1815711eee52b2d646e and post-merge main 5280fe99872a58f1b9d25b00a79d240ecd035f7d reproduces the run 34171261707 assertion ([] instead of [62]). Both source and test files are byte-identical across those commits; this is preexisting, not caused by #105442. The deadline fixtures originated in #101929; existing-fix sweep found no superseding clock fix.

Validation

Check Before After
Same 5 ms real scheduling delay at ownership clock reads 2 failed, 17 passed 19 passed
Disable production deadline guard (mutation control) — Both deadline tests reject over-processing
Change >= deadline boundary to > (mutation control) — Both deadline tests reject over-processing
Full Electron platform suite, normal and pressure replay — Each: 151 files / 2,139 tests passed; 2 files / 6 tests skipped
Desktop typecheck, touched-file ESLint and Prettier — Passed
Windows footguns, compat-pointer gate, diff whitespace — Passed

The replay injects actual pauses, not fabricated timestamps; the corrected fixtures explicitly control time. Local dependency setup initially lacked desktop packages/Electron; a clean lockfile install and Electron install resolved that before the full green runs.

NODE_OPTIONS="--require=$PWD/evals/desktop-reap-clock-pressure.cjs" \
  npm run test:desktop:platforms -w apps/desktop -- electron/backend-ownership.test.ts

Infographic

Deterministic desktop deadline tests

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on 781211b — test: make desktop orphan-reap deadline checks deterministic

⚠️ Warnings

OSV vulnerability scan · View job

28 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 5m10s vs 4m58s (+4.0%). 9 job(s) slower, 5 faster, 1 unchanged.

  • Python tests / Run tests: +32.0s
  • OSV scan / Scan lockfiles / osv-scan: -11.0s
  • Python lints / Windows footguns (blocking): -10.0s
  • OS-specific tests / Windows-only tests: +9.0s
  • OS-specific tests / macOS-only tests: -7.0s

@teknium1
teknium1 merged commit aa1a546 into main Sep 8, 2026
35 checks passed
@teknium1
teknium1 deleted the fix/desktop-reap-budget-clock branch September 8, 2026 00:08
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants