Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios doesn't trigger timeout when handler's delay is too long #1187

Open
4 tasks done
Alirezaja1384 opened this issue Apr 1, 2022 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node

Comments

@Alirezaja1384
Copy link

Alirezaja1384 commented Apr 1, 2022

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 14 or higher

Node.js version

v17.8.0

Reproduction repository

https://codesandbox.io/s/eager-paper-dkkkzs

Reproduction steps

  1. Fork the sandbox
  2. Run tests by yarn test

There are 3 tests in src/__tests__/request.js.

  1. uses a rest handler
  2. uses an external url
  3. uses a local server on port 3001

Current behavior

First one (MSW's rest handler) doesn't trigger timeout, so the promise resolves instead of being rejected and test fails. But other ones pass.

Expected behavior

It should reject the promise with ECONNABORTED code.

@Alirezaja1384 Alirezaja1384 added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Apr 1, 2022
@Alirezaja1384 Alirezaja1384 changed the title axios does'nt trigger timeout when respose takes too long Axios doesn't trigger timeout when respose takes too long Apr 1, 2022
@Alirezaja1384 Alirezaja1384 changed the title Axios doesn't trigger timeout when respose takes too long Axios doesn't trigger timeout when handler's delay is too long Apr 1, 2022
@kettanaito
Copy link
Member

Hey, @Alirezaja1384. Thanks for reporting this.

We're currently having issues with intercepting Axios requests properly. This may be related to #1169 where we're tracking the original issue. We should fix the said issue first and then see if it doesn't address this one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node
Projects
None yet
Development

No branches or pull requests

2 participants