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

Timeout option being ignored for HttpProvider #5235

Closed
1 task done
ghost opened this issue Jul 13, 2022 · 0 comments · Fixed by #5228
Closed
1 task done

Timeout option being ignored for HttpProvider #5235

ghost opened this issue Jul 13, 2022 · 0 comments · Fixed by #5228
Labels
Bug Addressing a bug

Comments

@ghost
Copy link

ghost commented Jul 13, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Timeout option was being ignored due to the missing AbortSignal inside options object.

Expected Behavior

Timeout option shouldn't be ignored and thus timeout for delayed requests should be canceled correctly by the demand of the user.

Steps to Reproduce

it('should timeout by delayed response', async function () {
            var provider = new HttpProvider('/fetchMock', { timeout: 500 });
            var web3 = new Web3(provider);

            fetchMock.mock('/fetchMock', 'Testing non-json format response', { delay: 1000 });

            await expect(web3.eth.getChainId()).to.be.rejectedWith(Error, 'CONNECTION TIMEOUT: timeout of 500 ms achived');
            fetchMock.restore();
});

Web3.js Version

1.x

Environment

No response

Anything Else?

Fixed by the latest commit of PR #5228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant