Skip to content

[APPS-2792] Add: local-execution resilience tests - #492

Closed
tyffical wants to merge 1 commit into
tiffany.trinh/apps-2792-secret-store-parityfrom
tiffany.trinh/apps-2792-local-execution-resilience-tests
Closed

[APPS-2792] Add: local-execution resilience tests#492
tyffical wants to merge 1 commit into
tiffany.trinh/apps-2792-secret-store-parityfrom
tiffany.trinh/apps-2792-local-execution-resilience-tests

Conversation

@tyffical

@tyffical tyffical commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Local-execution resilience testing milestone from 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 checks, not fixes:
    • Empirically confirm the RFC's "no process isolation" decision has the failure modes it assumes, rather than leave them unverified.

Architecture

  • The process.exit() test can't call runScriptLocally directly in the main Jest process — exiting would kill the whole test run.
  • It spawns the fixture as a child process instead, and asserts on the child's exit behavior:
Jest test process
  └─ spawns ──▶ local-execution.process-exit.fixture.ts (child process)
                  runScriptLocally() → customer fn calls process.exit()
                  → child terminates immediately
  └─ asserts on the child's exit code

Changes

2 changes across 2 files
What changed File
New test confirming a synchronous CPU-bound loop starves the event loop, so the current Promise.race timeout never fires — it can only settle once the loop finishes on its own. local-execution.resilience.test.ts
New test confirming process.exit() inside the customer function terminates the whole process immediately, bypassing runScriptLocally's try/finally cleanup — spawns a dedicated fixture as its own Jest process (since process.exit() can't safely run inside this Jest process) so the observed behavior is the real executeScriptLocally/runScriptLocally code path, not a hand-rolled emulation of it. local-execution.resilience.test.ts, local-execution.process-exit.fixture.ts
  • The third checklist item ("the queue survives a rejected execution and keeps running") is already covered by an existing test in local-execution.test.ts.

QA Instructions

  • Test-only change with no HTTP surface — verified via the unit test commands below, not a live endpoint.
yarn workspace @dd/tests test:unit packages/plugins/apps/src/vite/local-execution.resilience.test.ts
# Expected: 2 passed ✅ VERIFIED
yarn build:all && yarn test:unit
# Full, unscoped suite — a scoped run can't catch a process-wide guard leaking into
# an unrelated package's tests via a shared Jest worker (see the Confluence QA guide).
# Expected: Test Suites: 93 passed / Tests: 2261 passed, 1 skipped ✅ VERIFIED
yarn workspace @dd/apps-plugin run typecheck
# Expected: clean exit ✅ VERIFIED

Blast Radius

  • Test-only change; no production code touched.
  • Risk: low.

Out of Scope / Follow-ups

1 item deferred
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 to inform that decision with real data — 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: 603a8f1 | 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 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
@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 2 times, most recently from b8c3563 to 3258de8 Compare August 28, 2026 04:13
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch 3 times, most recently from d16eefb to a8f9952 Compare August 28, 2026 05:16
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from b6dd249 to 793a2c1 Compare August 28, 2026 05:38
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch 2 times, most recently from c44a69b to 91b68c7 Compare August 28, 2026 06:17
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from a1c90e6 to 54571f6 Compare August 28, 2026 06:42
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 91b68c7 to 28bc783 Compare August 28, 2026 06:44
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 54571f6 to 3a8d987 Compare August 28, 2026 07:20
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 28bc783 to 8aa14c2 Compare August 28, 2026 07:23
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 4b41eb5 to dd78fed Compare August 28, 2026 08:07
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 8aa14c2 to fa44b78 Compare August 28, 2026 08:10
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from dd78fed to 6a6640b Compare August 28, 2026 08:19
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from fa44b78 to 13f8d38 Compare August 28, 2026 08:20
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-wire-into-dev-server branch from 6a6640b to dc85a6c Compare August 28, 2026 17:12
@tyffical
tyffical force-pushed the tiffany.trinh/apps-2792-local-execution-resilience-tests branch from 13f8d38 to 04d8b27 Compare August 28, 2026 17:13
@tyffical

tyffical commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T18:10:57.263400Z 8c7928f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI 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.

Pull request overview

Friend, this PR adds resilience tests documenting known limitations of in-process backend execution.

Changes:

  • Tests synchronous CPU-bound timeout starvation.
  • Tests process.exit() cleanup behavior in a subprocess.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/plugins/apps/src/vite/local-execution.resilience.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c7928f483

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/plugins/apps/src/vite/local-execution.resilience.test.ts Outdated
…des (Milestone 7)

process.exit() inside a customer function can't be tested in-process without
killing the Jest worker running the assertion. Spawns
local-execution.process-exit.fixture.ts as its own Jest process so the
process.exit() call runs through the real executeScriptLocally/
runScriptLocally code path instead of a hand-rolled emulation of it.
@tyffical

tyffical commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #496 — this PR could not be reopened because its base branch (tiffany.trinh/apps-2792-secret-store-parity) was deleted, and GitHub blocks both reopening and re-basing a closed, stack-tracked PR once its base ref is gone. Same content, now rebased directly onto #490 (tiffany.trinh/apps-2792-dev-verify-cli).

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