Skip to content

Await watch shutdown and clean up failed startup - #303

Open
bcomnes wants to merge 2 commits into
fix/v12-watch-dependency-trackingfrom
bret/watch-lifecycle
Open

Await watch shutdown and clean up failed startup#303
bcomnes wants to merge 2 commits into
fix/v12-watch-dependency-trackingfrom
bret/watch-lifecycle

Conversation

@bcomnes

@bcomnes bcomnes commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #295.
Stacked on #294 so its watch dependency tests remain part of validation.

  • Await Chokidar closure and stop accepting new or queued rebuilds before shutdown drains the active build.
  • Dispose every acquired copy watcher, esbuild context, and development server even if another cleanup step fails.
  • Clean up partial watch startup, including browser/service-worker esbuild startup failures.
  • Stop watchers before removing test fixtures.

Validation

  • Full npm test passed outside the restricted runner: Node tests, Playwright, lint, installed-check, and TypeScript.
  • Six focused lifecycle regressions passed, covering awaited closure, repeated cycles, startup failure/retry, cleanup failure/retry, partial esbuild startup, active/queued rebuild shutdown, and stopping from the initial-build callback.
  • The local EMFILE failures reproduce in the restricted runner but not outside it; this PR does not claim the missing await caused them.

Merge order

Merge #294 first, then retarget this draft to master if GitHub does not do so automatically.
The conventions and watch-planner drafts follow this branch.

@coveralls

coveralls commented Sep 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34011495814

Coverage increased (+0.4%) to 94.828%

Details

  • Coverage increased (+0.4%) from the base build.
  • Patch coverage: 2 uncovered changes across 1 file (95 of 97 lines covered, 97.94%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
index.js 58 56 96.55%
Total (2 files) 97 95 97.94%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 8099
Covered Lines: 7864
Line Coverage: 97.1%
Relevant Branches: 2091
Covered Branches: 1799
Branch Coverage: 86.04%
Branches in Coverage %: Yes
Coverage Strength: 297.08 hits per line

💛 - Coveralls

@bcomnes
bcomnes marked this pull request as ready for review September 6, 2026 04:55
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.

2 participants