test(runtime): wire bounded fault injection harness#953
Open
luoye520ww wants to merge 3 commits into
Open
Conversation
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 free
to 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.
Problem\nThe existing fault-injection contract was only validated as a schema and did not exercise the real HTTP/SSE runtime boundaries used by recovery tests.\n\n## Scope\nThis PR aggregates the runtime harness follow-up for #925. It keeps fault injection explicitly opt-in and test-only.\n\n## Changes\n- Add a bounded, abort-aware FaultInjectionController with one-shot/reconfigurable activation.\n- Wire optional injection into the Node HTTP server and Kun serve runtime.\n- Exercise HTTP 429, bounded timeout response, malformed JSON, and SSE disconnect at the actual response boundary.\n- Keep normal production startup unchanged when no controller is supplied.\n\n## Non-goals\nDisk/process/renderer/storage fault hooks and a production UI are intentionally out of scope for this small runtime harness PR.\n\n## Validation\n-
pm.cmd --prefix kun test -- tests/fault-injection.test.ts tests/node-http-server.test.ts — 2 files, 19 tests passed\n-
pm.cmd run typecheck — passed\n-
pm.cmd --prefix kun run typecheck — passed\n-
pm.cmd run lint — passed\n-
pm.cmd run build — passed\n- git diff --check — passed\n\n## Review\nReviewed lifecycle/abort cleanup, default-off behavior, response teardown, cross-platform Node APIs, secret/error handling, and PR scope.\n\nSupersedes #925.