Thanks to visit codestin.com
Credit goes to github.com

Skip to content

resolve Jest timeout for server-based tests#617

Merged
nfriedly merged 2 commits into
express-rate-limit:mainfrom
AzmeerX:fix/jest-timeout-error
Apr 19, 2026
Merged

resolve Jest timeout for server-based tests#617
nfriedly merged 2 commits into
express-rate-limit:mainfrom
AzmeerX:fix/jest-timeout-error

Conversation

@AzmeerX

@AzmeerX AzmeerX commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Moved jest.setTimeout(60_000) into a beforeEach hook. this ensures the timeout is configured before the tests run
Jest's timeout enforcement now applies the extended limit from the start

Changes:

Uncommented import { platform } from 'node:process' (for platform-specific test skipping)
Wrapped the long-running server test in a describe block with proper timeout setup
Moved jest.useRealTimers() call to remain within the test function where it's needed

Fixed #611

@nfriedly

Copy link
Copy Markdown
Member

thanks!

@nfriedly nfriedly merged commit 2bb343c into express-rate-limit:main Apr 19, 2026
16 checks passed
@nfriedly

Copy link
Copy Markdown
Member

Oof, this didn't do the trick either: https://github.com/express-rate-limit/express-rate-limit/actions/runs/24637943753/job/72036615480

There's the 30/60 second thing which still doesn't seem to be working correctly, but that might be a red herring - this test should really be passing in under 30 seconds, so I think there's still some underlying flakiness that needs to be sussed out.

nfriedly added a commit that referenced this pull request Apr 21, 2026
…ests test

Working on the theory that the short 10ms timeout can sometimes trigger before processing of the request even starts.

Followup to #617 & #611
nfriedly added a commit that referenced this pull request Apr 24, 2026
* test: bump request timeout from 10ms to 50ms in flakey skipFailedRequests test

Working on the theory that the short 10ms timeout can sometimes trigger before processing of the request even starts.

Followup to #617 & #611
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.

2 participants