Repository navigation
test(dev): cover supervisor startup order and partial-line buffering - #264
Merged
dDevAhmed merged 1 commit intoOct 18, 2026
Conversation
Neither behaviour had coverage. dev-orchestrator.test.ts writes only whole lines
(child.stdout.write('ready\n')) and never asserts the order in which children are
spawned, so both regressions could land unnoticed.
DigiNodes#158: superviseDevProcesses walks specs in order and spawns each before registering
its listeners, so ordering is a real contract - a later workflow may depend on an
earlier one being up. Asserts the declared order is preserved, that a mid-loop
spawn failure is reported against the spec that actually failed, and that argv is
forwarded as an array so the spawner can keep shell:false.
DigiNodes#159: createPrefixedLineWriter buffers a trailing partial line precisely so a
secret-like value split across chunks is redacted as a whole. Covers the hold-until
newline behaviour, reassembly of a credential split mid-label, independent stdout
and stderr buffers so the streams cannot interleave, and the flush on stream end.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Two dev-supervisor behaviours had no coverage at all. The existing
dev-orchestrator.test.tswrites only whole lines (child.stdout.write('ready\n'))and never asserts the order in which children are spawned, so both of these
regressions could land without a single test turning red.
#158 — startup order is a real contract
superviseDevProcesseswalksspecsin order and spawns each child beforeregistering the next one's listeners. That ordering is load-bearing: a later
workflow may depend on an earlier one already being up. If the loop were ever
reordered or parallelised, nothing would fail.
Locked down here:
database → api → worker);and the workflow before it was started in order first;
shell: false.#159 — partial-line buffering is a security property
createPrefixedLineWriterbuffers a trailing partial line for one specific reason,stated in the source:
Eagerly emitting chunks would leak the tail of a split credential straight to the
terminal — the exact failure the buffering exists to prevent. Four cases cover it:
api_tok+en=sk_live_…) is reassembled andredacted as one value, so the raw secret never appears;
Issue references
Closes #157
Closes #158
Closes #159
Closes #160
What this PR actually changes
Implemented in full — #158 and #159.
Not implemented here:
generator, a different subsystem from the dev supervisor.
suite asserts
captured.stderrText()).toContain('[api] warning')and thatstdout and stderr stay on separate paths, which is the property that issue asks
for. This file adds buffering coverage on top of it rather than repeating it.
Note
The existing suite's "terminates children and removes signal handlers after
SIGINT/SIGTERM" emits each signal once, so the
shuttingDownidempotency guardis untouched by this PR and is covered separately. The tests here deliberately do
not overlap that path.
Not run
node_moduleswas not installed and the suite was not executed, per yourconstraint. Worth one local run to confirm — particularly the redaction case,
which asserts against
redactSecretLikeText's real behaviour for anapi_token=assignment.