Skip to content

test(desktop-gpui): run the real app through Instant crashes, cancels and recovery in CI - #3109

Merged
richiemcilroy merged 7 commits into
mainfrom
test/instant-real-app-reliability
Oct 24, 2026
Merged

richiemcilroy merged 7 commits into
mainfrom
test/instant-real-app-reliability

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Instant mode's worst failures happen in the real app, across process deaths: a crash during start or capture, a start stopped while it is still in flight, a recovery on the next launch. The unit and mock-server tests cover each piece in isolation; nothing ran the whole app through them. This adds a suite that does, and a macOS job that runs it on every pull request touching the Instant path and nightly.

Builds on #3106.

flowchart LR
    T[cargo test real_app --ignored] --> M[MockCap on 127.0.0.1]
    T --> S["Sandbox: store pointing at the mock,<br/>own recordings and logs"]
    S --> A[Built cap-gpui binary]
    A -- "create, presign, segments,<br/>recording-complete, delete" --> M
    T -- "kill -9, relaunch,<br/>CAP_GPUI_AUTO_RECORD / AUTO_RECOVER" --> A
    T --> C["Check the mock's created, deleted and stored objects,<br/>and the sandbox's projects and journal"]
Loading

Cases (apps/desktop-gpui/src/upload/real_app_tests.rs)

  • real_app_instant_recording_uploads_and_verifies: a normal recording reaches Verified, the mock holds its confirmation, nothing is deleted and the cleanup journal is empty.
  • real_app_crashes_never_delete_a_recording_with_media: kills the app at 8 points, from the server video's creation through the first seconds of capture, noting each recording's folder and media right after its kill, then ages the leftovers and relaunches. A recording that held media keeps its folder, its media and its server video, and every crashed recording that held none in a folder still in progress has its server video deleted.
  • real_app_recovered_recording_uploads: kills the app after four finished segments, relaunches with CAP_GPUI_AUTO_RECOVER=1, and requires the recovered recording to verify under the same video id with its segments stored.
  • real_app_cancelled_start_deletes_its_video: stops a recording while its start is in flight. The server video it created is deleted and no project or journal entry is left.

They are #[ignore]d because they need a built app and screen recording permission:

CAP_GPUI_REAL_APP_BIN=target/debug/cap-gpui \
  cargo test --bin cap-gpui real_app -- --ignored --test-threads=1

CAP_GPUI_REAL_APP_ARTIFACTS keeps each sandbox (app logs, recordings, journal). If the app does not reach a step in time, its threads are sampled into hang-sample.txt before the test fails, so a hang can be diagnosed from the job's artifacts.

Mock server

MockCap now records the video ids it creates and deletes (created(), deleted()), so a test can tell which recording's video was removed.

CI (.github/workflows/instant-reliability.yml)

  • Runs on Blacksmith macOS 15 with the GPUI build cache, for pull requests that touch the Instant upload, recording, cleanup, recovery or segment muxing code, nightly, and on dispatch. A scope job runs it for this repository's own changes, including workflow edits, and for fork pull requests only when they change Instant code.
  • Grants Screen Recording to the app and test binaries, wakes the display and adds BlackHole, as verify-recording.yml does (the start chime plays before capture begins).
  • Uploads the sandboxes when the job fails.

RetriggerView in GreptileConfidence Score: 5/5

The changes since the previous review appear safe to merge.

Summary

This revision restores the workflow’s own path trigger and adds a small job that decides whether to run the macOS suite.

  • Real-app tests check Instant uploads across crashes, stops, and recovery.
  • A macOS job runs real-app Instant checks on relevant changes.

All supplied previous threads were unnumbered and manually resolved by richiemcilroy without explanatory replies. The current code counts unfinished media, retries missed cancellations, stops child apps on drop, and removes the accessor comments.

Reviews (5) · Last reviewed commit: "ci: run the Instant reliability job on i..." · Reviewed by Greptile

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread apps/desktop-gpui/src/upload/real_app_tests.rs Outdated
Comment thread apps/desktop-gpui/src/upload/real_app_tests.rs Outdated
Comment thread apps/desktop-gpui/src/upload/real_app_tests.rs
Comment thread apps/desktop-gpui/src/upload/verify_tests.rs Outdated
… cancelled start, and kill apps a failed case leaves running
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cap-status Ready Ready Preview Oct 24, 2026 3:51pm UTC

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 1 security concern(s).

Comment thread .github/workflows/instant-reliability.yml

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 1 potential issue (1 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread apps/desktop-gpui/src/upload/real_app_tests.rs Outdated
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread .github/workflows/instant-reliability.yml
…tory, and on fork changes only when they touch Instant code
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 3 other findings in Capy.

Open in Capy

@richiemcilroy
richiemcilroy changed the base branch from fix/gpui-instant-crash-recovery to main October 24, 2026 19:27
@richiemcilroy
richiemcilroy merged commit d452037 into main Oct 24, 2026
48 checks passed

This branch was successfully deployed

2 active deployments
Preview – cap-web — b6c35c5e Deployed Oct 24, 2026 by vercel[bot]
Preview – cap-status — b6c35c5e Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant