[fix] .timeout(x) doesn't wait before aborting the request on node.js 26.3.0 on linux
Describe the bug
Node.js version: 26.3.0 (It worked on 26.2.0 and older)
OS version: ubuntu-latest on github actions, also the latest code-server docker image (also ubuntu) on Unraid 7.2.6 (Linux kernel 6.12.87)
Github actions has it passing on macOS. It skipped windows because linux failed before windows finished, and I don't have a windows machine handy right now to test it myself :/
Description: I'm seeing a consistent failure in my test that uses an express endpoint that drops the request and relies on supertest's .timeout(x) method to end the request.
On earlier node.js versions, calling request(app).get('/whatever').timeout(n) would send the request and only throw/reject if n milliseconds passed. Starting with node.js 26.3.0 on linux, the timeout now triggers immediately, and the request is never sent, which causes my test to fail.
It's possible that this is a node.js bug, but since I'm only seeing it with supertest, I figured I'd report it here first.
Actual behavior
.timeout(n) aborts the request immediately without even calling the server endpoint. (On node 26.3.0 on linux)
Expected behavior
.timeout(n) waits n milliseconds for the request to complete, and only aborts if it doesn't complete within that time frame.
Code to reproduce
git clone https://github.com/express-rate-limit/express-rate-limit.git
cd express-rate-limit
npx pnpm install
npx jest test/library/middleware-test.ts -t "response closes"Checklist
- I have searched through GitHub issues for similar issues.
- I have completely read through the README and documentation.
- I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
Source: forwardemail/supertest