Skip to content

fix(engine): re-panic faults before exit notification - #722

Merged
houko merged 1 commit into
mainfrom
fix/engine-fault-race
Nov 18, 2026
Merged

houko merged 1 commit into
mainfrom
fix/engine-fault-race

Conversation

@houko

@houko houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #703.

Engine.run now re-panics a fault immediately when CheckCommits is enabled, before closing its normal-exit notification. Fault-isolation subprocess tests therefore observe the intended unrecovered panic instead of racing with a closed exited channel.

Targets

  • Shared code (core, base, ui, tsx, the nsgo tool)
  • macOS
  • iOS
  • tvOS
  • watchOS
  • Android
  • Windows
  • Linux
  • Web
  • Mini programs
  • Docs or website only

Screenshots

None. This changes test fault handling.

Verification

  • go tool nsgo check -target all
  • go tool nsgo test
  • go tool nsgo test -run 'TestEngineFaultIsolation/check' ./internal/engine -- -count=200 -cpu=1,2,8

Checklist

  • The title is a Conventional Commit, such as fix(linux): keep the caret after a paste; a squash merge uses it as the commit subject.
  • Docs whose facts change are updated, and CHANGELOG.md's Unreleased has a line for a capability users can see.
  • New third-party code, assets and dependencies name their source and license.

@github-actions github-actions Bot added documentation Improvements or additions to documentation core bug Something isn't working size/XS labels Nov 18, 2026
@houko

houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. Moving close(e.exited) after the CheckCommits re-panic removes the race in #703: the test goroutine can no longer wake on exited and fail with "swallowed its panic" before the engine goroutine panics. run runs on its own goroutine (go e.run) with nothing above it to recover, so the re-panic always ends the process and leaving exited open on that path strands no waiter; every other path still closes it. Verified on Linux: go test -count=200 -cpu=1,2,8 -run 'TestEngineFaultIsolation/check' ./internal/engine passes, and with the re-panic disabled the subtest still fails ("CheckCommits did not re-panic: exit status 1"). CI is green.

@houko
houko merged commit b304eea into main Nov 18, 2026
21 checks passed
@houko
houko deleted the fix/engine-fault-race branch November 18, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core documentation Improvements or additions to documentation size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

engine: TestEngineFaultIsolation/check is flaky because the fault handler closes exited before CheckCommits re-panics

1 participant