You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even ridiculously small files (8 bytes) fail because of this.
This scenario is also noticeable on v18 version of node.
A test snippet:
it('should upload cat test 1',async()=>{constres=awaitrequest(app).post('/api').attach('file','cat1.png').attach('file2','cat2.png');expect(res.statusCode).toEqual(200);expect(res.body).toEqual({message: 'pass!'})});
When I run ~14 of these in a single test suite the error occurs. (The test suit in the repro)
Also, for simplicity of this test suite I didn't use any multipart/form-data parser.
We're unable to upgrade our repo with thousands of tests from v16 to v20 or even v18 because of this. Not sure how to proceed. Any advice will be highly appreciated!
Actual behavior
Node throws write EPIPE error supposedly due to how supertest handles streaming of these files.
Describe the bug
Node.js version: v20.11.0
OS version: macOS Sonoma 14.2.1
Description:
When trying to attach 2 cat images (7mb and 560kb) node throws "write EPIPE" error.
The list of facts:
A test snippet:
When I run ~14 of these in a single test suite the error occurs. (The test suit in the repro)
Also, for simplicity of this test suite I didn't use any multipart/form-data parser.
Perhaps, connected to #824 or #491.
We're unable to upgrade our repo with thousands of tests from v16 to v20 or even v18 because of this. Not sure how to proceed. Any advice will be highly appreciated!
Actual behavior
Node throws write EPIPE error supposedly due to how supertest handles streaming of these files.
Expected behavior
Should upload files without this error occurring.
Code to reproduce
A small repo with a test to reproduce the issue:
https://github.com/eddienubes/supertest-write-epipe-bug-repro
Checklist
The text was updated successfully, but these errors were encountered: