Skip to content

[Bug]: Tinypool throws Error: write UNKNOWN #1142

@WesleyHovick

Description

@WesleyHovick

Version

System:
    OS: Windows 11 10.0.26200
    CPU: (32) x64 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
    Memory: 23.02 GB / 47.78 GB
Browsers:
    Edge: Chromium (143.0.3650.96)
Binaries:
    Node: 22.22.0
    Yarn: 1.22.22

Details

When bumping from @rstest/core v0.9.4 to either v0.9.5 or v0.9.6, our tests get intermittent failures from tinypool.

On Windows, Node.js named-pipe IPC channels can intermittently throw "Error: write UNKNOWN" when a forked worker process exits while the parent is mid-send. Tinypool ≤ 2.1.0 has no try-catch around this call, so the error propagates up and fails a random test.

We are on node v22.22.0, TypeScript 4.9.5, using Yarn workspaces 1.22.22.

A patch/workaround was to add a try-catch to tinypool so the broken pipe is silently ignored - then the worker's exit handler will handle cleanup. After adding this to tinypool all tests pass on 0.9.5 (haven't tried 0.9.6 yet) - demonstrating the issue, at least on our end.

What changed in 0.9.5+ that would have caused this? Can you consider alternatives to tinypool to mitigate this?

We are in the process of fully migration tens of thousands of tests to rstest from jest and this will be a hard stop for us since this directly seems to cause tests to suddenly fail with no changes on our end from 0.9.4 to 0.9.5+.

Reproduce link

n/a

Reproduce Steps

I don't know exactly what the repro steps are other than I can repro it in our codebase in one of our monorepo packages consistently when on 0.9.5 and 0.9.6. It does not repro on 0.9.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions