Skip to content

test(writer): cover PatchedEncodingEncoder narrow-width + error paths#57

Merged
dfa1 merged 2 commits into
mainfrom
test/patched-encoder-coverage
Jun 19, 2026
Merged

test(writer): cover PatchedEncodingEncoder narrow-width + error paths#57
dfa1 merged 2 commits into
mainfrom
test/patched-encoder-coverage

Conversation

@dfa1

@dfa1 dfa1 commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Add tests exercising every integer PType through toLongs/fromLongs/PTypeIO.set,
the non-primitive and unsupported-ptype throw paths, and the no-bit-width-gain
notApplicable branch. Coverage on PatchedEncodingEncoder goes from 42 missed
lines to 1 (an unreachable defensive default in fromLongs).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Add tests exercising every integer PType through toLongs/fromLongs/PTypeIO.set,
the non-primitive and unsupported-ptype throw paths, and the no-bit-width-gain
notApplicable branch. Coverage on PatchedEncodingEncoder goes from 42 missed
lines to 1 (an unreachable defensive default in fromLongs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 force-pushed the test/patched-encoder-coverage branch from 05e19e0 to a9bda35 Compare June 19, 2026 09:48
runAndAwait waited on a signal raised in the task's finally, while pending was
decremented later in submit's own finally — so a caller reading pending()
right after runAndAwait returned could still see the task counted. Replace the
signal with a CountDownLatch counted down after the decrement, making the
decrement happen-before the await returns. Also bail out early when closed,
matching submit and avoiding an indefinite wait on a closed worker.

Fixes flaky IoWorkerTest.pending_isZeroAfterTaskCompletes (reproduced on CI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 95c06b1 into main Jun 19, 2026
6 checks passed
@dfa1 dfa1 deleted the test/patched-encoder-coverage branch June 19, 2026 12:06
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.

1 participant