Uh oh!
There was an error while loading. Please reload this page.
[APPS-2792] Add: local-execution resilience tests (Milestone 7) - #492
Draft
tyffical wants to merge 1 commit into
Draft
Conversation
…des (Milestone 7) Two targeted resilience checks, not fixes — Milestone 7 in the Kickoff doc exists to empirically confirm the actual failure modes of running backend functions in-process (no child process/thread isolation) before deciding whether closing them is worth the cost the RFC already weighed against fork()-based isolation. Confirmed: a synchronous CPU-bound loop starves the event loop entirely, so the current Promise.race timeout never gets a chance to fire — it can only settle once the loop finishes on its own. Confirmed via a real child process: process.exit() inside the customer function terminates the whole process immediately, bypassing try/finally cleanup entirely — no JS-level exception handling in this design can intercept it, so this takes the whole dev server down, not just its own execution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
domains/chaos-engineeringtargets Datadog-owned Kubernetes clusters, a mismatch for this in-process, customer-dev-server model.Changes
Promise.racetimeout never gets a chance to fire — it can only settle once the loop finishes on its own.process.exit()can't safely run inside this same Jest process) confirmingprocess.exit()inside the customer function terminates the whole process immediately, bypassingtry/finallycleanup entirely.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 ✅ VERIFIEDyarn workspace @dd/tests test:unit packages/plugins/apps # Expected: 25 suites / 324 tests passed ✅ VERIFIEDyarn workspace @dd/apps-plugin run typecheck # Expected: clean exit ✅ VERIFIEDBlast Radius
Out of Scope / Follow-ups
worker_threads) to close the confirmed sync-hang andprocess.exit()gapsDocumentation