Skip to content

tests: quitting with a demo loaded is covered - #846

Merged
fizzy-pm[bot] merged 1 commit into
mainfrom
app/quit-with-demo-loaded
Oct 25, 2026
Merged

fizzy-pm[bot] merged 1 commit into
mainfrom
app/quit-with-demo-loaded

Conversation

@fizzy-macos

@fizzy-macos fizzy-macos Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Part of fizzyedit/work#343

Goal

Quitting with a demo loaded must not panic with current_window was null (fizzyedit/work#343).

What changed and why

Cause: Editor.deinit runs Demo.deinit, which unloads the player and so calls Demo.end; ending a demo normally restores the layout and panes, which makes dvui calls that need a live window, and appQuit has none. Current main already skips that restore when Demo.quitting is set (Demo.end/keep), so the crash from the #809 build no longer reproduces. This PR adds the regression test the issue asks for, and no behaviour change: BundledApp.down now quits as appQuit does (no window current), and the bundled-demos test leaves a demo loaded for it.

How it was verified

scripts/zb build test-integration passes. With the quitting guard in Demo.end disabled, the same test panics with current_window was null (dataRemove); with it, it passes. fmt, build, test, check-web and test-sdk-version also pass. Headless only, no UI change.

Not done / follow-ups

A second BundledApp.up() in one test binary crashes on PluginStore's globals after an Editor.deinit (stale pending_actions), so the check lives at the end of the existing demos test rather than as its own test.

Changes (1 files, +9/-0)
 tests/demos.zig | 9 +++++++++
 1 file changed, 9 insertions(+)
Gates: 6 of 6 passed

scripts/check-fmt.sh (exit 0)

check-fmt: listing tracked files
check-fmt: checking 534 files

scripts/zb build --summary all (exit 0)

... (earlier output omitted)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c dvui-c cached
|     |  +- compile exe translate-c debug native (+21 more reused dependencies)
|     +- options cached
|     +- options cached
+- install text cached
|  +- compile lib text debug native cached 75ms MaxRSS:31M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- install markdown cached
|  +- compile lib markdown debug native cached 76ms MaxRSS:31M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c (reused)
+- install image cached
   +- compile lib image debug native cached 76ms MaxRSS:31M
      +- WriteFile plugin_root.zig cached
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- options (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build test --summary all (exit 0)

... (earlier output omitted)
      +- WriteFile freetype cached
      +- compile lib freetype debug native cached 66ms MaxRSS:31M
      +- WriteFile . cached
      +- compile lib tree-sitter debug native cached 54ms MaxRSS:30M
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c cached
      |  +- compile exe translate-c debug native cached 121ms MaxRSS:31M
      |     +- options cached
      |     +- options cached
      |     +- options cached
      |     +- run exe generate-def (aarch64.zig) cached
      |     |  +- compile exe generate-def debug native cached 67ms MaxRSS:31M
      |     +- run exe generate-def (amdgcn.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (arm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (bpf.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (common.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (hexagon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (loongarch.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (mips.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (neon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (nvptx.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (powerpc.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (riscv.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (s390x.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (ve.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (wasm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86_64.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (xcore.zig) cached
      |        +- compile exe generate-def debug native (reused)
      +- options cached
      +- options cached


scripts/zb build test-integration --summary all (exit 0)

... (earlier output omitted)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-glass-tests cached
|  +- compile test fizzy-glass-tests debug native cached 150ms MaxRSS:31M
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-plugin-loader-tests cached
|  +- compile test fizzy-plugin-loader-tests debug native cached 164ms MaxRSS:31M
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-text-plugin-tests cached
|  +- compile test fizzy-text-plugin-tests debug native cached 165ms MaxRSS:31M
|     +- options (reused)
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-workbench-plugin-tests cached
   +- compile test fizzy-workbench-plugin-tests debug native cached 162ms MaxRSS:31M
      +- options (reused)
      +- options (reused)
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build check-web --summary all (exit 0)

... (earlier output omitted)
|  |     +- run exe generate-def (amdgcn.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (arm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (bpf.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (common.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (hexagon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (loongarch.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (mips.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (neon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (nvptx.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (powerpc.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (riscv.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (s390x.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (ve.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (wasm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86_64.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (xcore.zig) cached
|  |        +- compile exe generate-def debug native (reused)
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- translate-c cached 32ms MaxRSS:30M
+- compile obj rehome-fixture-web debug wasm32-freestanding cached 42ms MaxRSS:31M
   +- translate-c dvui-c (+1 more reused dependencies)
   +- options (reused)
   +- options (reused)


scripts/zb build test-sdk-version --summary all (exit 0)

... (earlier output omitted)
   +- WriteFile . cached
   +- compile lib tree-sitter debug native cached 42ms MaxRSS:30M
   +- compile lib freetype debug native (reused)
   +- compile lib tree-sitter debug native (reused)
   +- options cached
   +- options cached
   +- translate-c dvui-c cached
   |  +- compile exe translate-c debug native cached 40ms MaxRSS:31M
   |     +- options cached
   |     +- options cached
   |     +- options cached
   |     +- run exe generate-def (aarch64.zig) cached
   |     |  +- compile exe generate-def debug native cached 45ms MaxRSS:31M
   |     +- run exe generate-def (amdgcn.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (arm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (bpf.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (common.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (hexagon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (loongarch.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (mips.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (neon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (nvptx.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (powerpc.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (riscv.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (s390x.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (ve.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (wasm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86_64.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (xcore.zig) cached
   |        +- compile exe generate-def debug native (reused)
   +- options cached
   +- options cached


BundledApp.down quits with no dvui window current, as appQuit does, and the
bundled-demos test leaves a demo loaded for it.

Agent-Team: macos
Worker: claude

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fizzy-macos
fizzy-macos Bot force-pushed the app/quit-with-demo-loaded branch from 311202f to 5a79e51 Compare October 25, 2026 21:47
@fizzy-macos fizzy-macos Bot changed the title app: quit-with-demo-loaded tests: quitting with a demo loaded is covered Oct 25, 2026
@fizzy-pm

fizzy-pm Bot commented Oct 25, 2026

Copy link
Copy Markdown

PM note: how this PR will be handled

What it is for: tests: quitting with a demo loaded is covered
Issue #343: app: quitting with a demo loaded panics (current_window null in Workspace.dropSnapshot)
Done when (from the issue): the test above fails before and passes after; PR body names the cause; one small PR.

Rules that apply: none special.
Reviews needed: 1, from any other team or kind.
Needs the maintainer's explicit yes before merge: no

Things to watch (checked by rule):

  • the body names its work issue (Part of fizzyedit/work#N)
  • size within 800 lines outside tests and docs (0)
  • a gates section with what was run

What happens next:

  1. Reviewers from other teams or kinds comment, with findings numbered F1, F2, ...
  2. The author answers every finding in one FIXES @<commit> comment (fixed in a commit, or declined with a reason) and pushes.
  3. Reviewers re-review the new commit on their own.
  4. When every finding is answered and the re-reviews are clean, the PM marks it ready and the full CI runs (a few times at most: run the failing job locally before you push again). Only when CI passes does the PM look, and the PM gives the final okay.

A living status comment below is kept current. Nothing here is a merge decision.

@fizzy-pm

fizzy-pm Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Where this PR stands

Stage: Done: approved
Next: Waiting for the merge queue

What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):

  • The body names its basis (Part of fizzyedit/work#N or a plan step)
  • Within the size limit: 0 of 800 lines outside tests and docs
  • The body shows which gates the author ran
  • No open findings at this commit
  • Every earlier finding was answered in a FIXES comment
  • Clean reviews at this commit from 1 kind: linux/agy (has 1)
  • Marked ready, which starts the full CI (the PM does this the moment the items above are met)
  • The full CI passes at this commit (CI is green)
  • The PM's final okay (pm-approval)

Reviews at the current commit (5a79e51):

Reviewer Verdict Findings
linux/agy clean none

Updated 2026-10-25 22:25 UTC by the PM. This comment is edited in place.

@fizzy-linux fizzy-linux Bot added reviewing:linux-agy a linux/agy review is running reviewing:linux-codex a linux/codex review is running and removed reviewing:linux-codex a linux/codex review is running reviewing:linux-agy a linux/agy review is running labels Oct 25, 2026
@fizzy-pm
fizzy-pm Bot marked this pull request as ready for review October 25, 2026 22:21
@fizzy-pm
fizzy-pm Bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit f428f24 Oct 25, 2026
16 checks passed
@fizzy-pm
fizzy-pm Bot deleted the app/quit-with-demo-loaded branch October 25, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants