test(engine): cover spawnStreamingEncoder lifecycle and cleanup paths#380
Merged
vanceingalls merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
This was referenced Apr 21, 2026
Collaborator
Author
This was referenced Apr 21, 2026
Merged
perf(producer): hdr benchmark harness — --tags filter, peak heap/RSS tracking, bench:hdr script
#382
Merged
0294c06 to
cc0422f
Compare
469db85 to
ae2d4a7
Compare
cc0422f to
8638446
Compare
ae2d4a7 to
5f4e626
Compare
8638446 to
dad30f7
Compare
cbdf78d to
ca75d84
Compare
dad30f7 to
b3cd341
Compare
4b1cbf9 to
f2464f3
Compare
adc776e to
143a1db
Compare
f2464f3 to
72f4d29
Compare
143a1db to
6ece916
Compare
72f4d29 to
2196dec
Compare
6ece916 to
e638a99
Compare
2196dec to
2c19da9
Compare
e638a99 to
5fb85c5
Compare
2c19da9 to
40e2154
Compare
5fb85c5 to
d84c3ea
Compare
40e2154 to
efe5bcb
Compare
d84c3ea to
4b68ca4
Compare
efe5bcb to
633de87
Compare
4b68ca4 to
4be516a
Compare
633de87 to
ef05bfc
Compare
4be516a to
5a225bf
Compare
ef05bfc to
1b05a9e
Compare
c7fcca8 to
bc1bac0
Compare
4c7b80a to
5512a6a
Compare
bc1bac0 to
7d56ccc
Compare
5512a6a to
c0836ce
Compare
7d56ccc to
5262779
Compare
c0836ce to
f82f2cb
Compare
5262779 to
49ca88b
Compare
3aca369 to
f5be292
Compare
Add unit tests that mock child_process.spawn so we can drive an in-memory 'ffmpeg' through the success/failure paths used by the producer's HDR encoder and by Chunk 5A's defensive close() in renderOrchestrator. Covers: - successful exit after explicit close() - non-zero exit before close() returns a failure result (no throw) - ENOENT on spawn returns a failure result (no throw) - abort signal triggers SIGTERM and a 'cancelled' result - close() is idempotent and never throws on a second call - writeFrame returns false after the encoder has exited - close() detaches the abort listener so post-close aborts don't re-kill ffmpeg These contracts are what the renderOrchestrator try/finally cleanup added in Chunk 5A relies on, and what the ffprobe-unavailable test (Chunk 9B) hinted at for the encoder side.
Collaborator
Author
Merge activity
|
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
Add unit tests that mock
child_process.spawnto drive an in-memory "ffmpeg" through the success/failure paths used by the producer's HDR encoder and by Chunk 5A's defensiveclose()inrenderOrchestrator.Why
Chunk 9Dofplans/hdr-followups.md. The contracts the orchestrator's try/finally cleanup (Chunk 5A) and the abort path rely on were entirely uncovered. A regression inspawnStreamingEncoder's lifecycle handling would surface as a leaked ffmpeg process or a hung render, both of which are hard to diagnose after the fact.What changed
packages/engine/src/services/streamingEncoder.test.ts: 7 new specs covering:close().close()returns a failure result (no throw).ENOENTon spawn returns a failure result (no throw).SIGTERMand a"cancelled"result.close()is idempotent and never throws on a second call.writeFramereturnsfalseafter the encoder has exited.close()detaches the abort listener so post-close aborts don't re-kill ffmpeg.These contracts are what the
renderOrchestratortry/finally cleanup added in Chunk 5A relies on, and what the ffprobe-unavailable test (Chunk 9B) hinted at for the encoder side.Test plan
Stack
Chunk 9D of
plans/hdr-followups.md. Test-only change, complements Chunk 5A.