Skip to content

[APPS-2792] Add: local-execution resilience tests (Milestone 7) - #492

Draft
tyffical wants to merge 9 commits into
tiffany.trinh/apps-2792-wire-into-dev-serverfrom
tiffany.trinh/apps-2792-local-execution-resilience-tests
Draft

[APPS-2792] Add: local-execution resilience tests (Milestone 7)#492
tyffical wants to merge 9 commits into
tiffany.trinh/apps-2792-wire-into-dev-serverfrom
tiffany.trinh/apps-2792-local-execution-resilience-tests

Conversation

@tyffical

@tyffical tyffical commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Milestone 7 in the Local Node Execution Kickoff doc — renamed/descoped from "Chaos-engineering resilience testing" since domains/chaos-engineering targets Datadog-owned Kubernetes clusters, a mismatch for this in-process, customer-dev-server model.
  • Two targeted resilience checks, not fixes: empirically confirm the actual failure modes of the RFC's "no process isolation" decision, rather than leave them as assumed-but-unverified.

Changes

What changed File
New test confirming a synchronous CPU-bound loop starves the event loop, so the current Promise.race timeout never gets a chance to fire — it can only settle once the loop finishes on its own. local-execution.resilience.test.ts
New test (via a real child process, since process.exit() can't safely run inside this same Jest process) confirming process.exit() inside the customer function terminates the whole process immediately, bypassing try/finally cleanup entirely. local-execution.resilience.test.ts

The third Milestone 7 task ("the queue survives a rejected execution and keeps running") was already covered by an existing test in local-execution.test.ts, per the Kickoff doc's own checklist.

QA Instructions

yarn workspace @dd/tests test:unit packages/plugins/apps/src/vite/local-execution.resilience.test.ts
# Expected: 2 passed ✅ VERIFIED
yarn workspace @dd/tests test:unit packages/plugins/apps
# Expected: 25 suites / 324 tests passed ✅ VERIFIED
yarn workspace @dd/apps-plugin run typecheck
# Expected: clean exit ✅ VERIFIED

Blast Radius

  • Test-only change, no production code touched. Zero effect on shipping behavior.
  • Risk: none.

Out of Scope / Follow-ups

Item Status Next step
Whether to pursue real process/thread isolation (e.g. pooled worker_threads) to close the confirmed sync-hang and process.exit() gaps deferred These tests exist specifically to inform that decision with real data rather than speculation — a follow-up design discussion, not blocking this PR.

Documentation

@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch 2 times, most recently from c2676bc to db2d170 Compare August 24, 2026 16:47
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch 4 times, most recently from c994af1 to fe1ce1f Compare August 24, 2026 20:09
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from ce94528 to d02d8bd Compare August 25, 2026 00:23
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from fe1ce1f to 8777af3 Compare August 25, 2026 00:25
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from d02d8bd to d1d88d6 Compare August 25, 2026 01:09
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 8777af3 to 91844e5 Compare August 25, 2026 01:10
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from d1d88d6 to 813061b Compare August 25, 2026 04:34
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 91844e5 to 8fa667c Compare August 25, 2026 15:27
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 96a5e43 to 18c9216 Compare August 25, 2026 16:57
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 8fa667c to 28fb51c Compare August 26, 2026 01:51
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Aug 26, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a0d01dd | Docs | View more details | Give us feedback!

@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch 3 times, most recently from 5b24d84 to 570261e Compare August 26, 2026 02:31
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 28fb51c to 7805ce2 Compare August 26, 2026 02:39
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 235b1a5 to bced83c Compare August 26, 2026 04:28
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 7805ce2 to 7f5e32e Compare August 26, 2026 04:33
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from bced83c to b823f05 Compare August 26, 2026 15:42
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 7f5e32e to a2d89c8 Compare August 26, 2026 16:17
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from b823f05 to 68e0026 Compare August 26, 2026 17:28
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from a2d89c8 to a110cb0 Compare August 26, 2026 17:32
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 68e0026 to 60e9fcc Compare August 26, 2026 17:56
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from a110cb0 to 84beda0 Compare August 26, 2026 18:10
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch 3 times, most recently from 959d0e8 to d3707a3 Compare August 27, 2026 16:44
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch 8 times, most recently from 05c85bc to 8a73a78 Compare August 27, 2026 22:43
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from ea35a06 to 512d47a Compare August 27, 2026 23:07
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch 2 times, most recently from 189f9b3 to d1bd1c0 Compare August 27, 2026 23:52
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 512d47a to ac2df41 Compare August 28, 2026 01:21
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 8f10bb6 to e6b3d80 Compare August 28, 2026 01:27
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from ac2df41 to 4e21289 Compare August 28, 2026 01:28
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from e6b3d80 to e3d1864 Compare August 28, 2026 01:46
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 4e21289 to af19a80 Compare August 28, 2026 01:47
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from e3d1864 to a37c927 Compare August 28, 2026 02:02
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from af19a80 to e3f1b34 Compare August 28, 2026 02:02
…tion

A customer module's own top-level evaluation runs before this execution's
box exists, and previously fell back to a plain undefined read instead of
failing the way a real Datadog deployment does at that same point. Also
reinstalls the accessor if a prior execution's customer code deleted
globalThis.$, so that deletion doesn't permanently break every later
execution in the same dev-server process.
rollupConfig.mjs's `external` list only matched a dependency's bare
specifier exactly, so `rollup/parseAst` (needed by the new dev-server
module-graph collector) got bundled instead of externalized despite
`rollup` being declared as a dependency. The bundled copy pulls in
Rollup's own native-binary platform loader, which throws through
`@rollup/plugin-commonjs`'s dynamic-require interop the moment a
consumer's real dev server calls it — breaking every published plugin
package for real users, not just this repo's own tests. Switched the
`external` option to a function that also matches subpath imports
(`id === name || id.startsWith(name + '/')`) for every declared
dependency and peer dependency.

Also drops a stray blank line introduced between a comment and the
test it documents in local-execution.test.ts.
The priming loadModule call (needed to populate the module graph for
connection-ID collection before the real execution starts) evaluates
the entry's real top-level code and runs before executeScriptLocally
installs its own hang-detection timeout — so it had no bound of its
own. A customer module with a hanging top-level await would wedge the
request forever. Wraps it in the same withTimeout helper the rest of
this file already uses, now exported for this cross-module use.
…rver output

The SSR transform Vite actually runs for a dev-server-only load rewrites every
import into a __vite_ssr_import__(...) call and resolves specifiers to
absolute paths, which the plain-ImportDeclaration AST search built for a real
Rollup build can't parse. Read each module's original source from disk and
strip TS/JSX with esbuild in isolation instead, so the parser sees the same
untransformed import syntax the production build path already trusts.
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from a37c927 to 08daffe Compare August 28, 2026 03:40
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from e3f1b34 to a0d01dd Compare August 28, 2026 03:41
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 08daffe to b8c3563 Compare August 28, 2026 04:04
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.

1 participant