-
Notifications
You must be signed in to change notification settings - Fork 579
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
feat: set fetch timeout to 300 seconds #1386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would be nice with a test.
@ronag Like no timeout for a request taking 60 seconds for example? |
Or a timeout for a request taking more than 300s. Look at out other test and how we handle timeout testing. |
Co-authored-by: Michaël Zasso <[email protected]>
@ronag added tests |
Codecov Report
@@ Coverage Diff @@
## main #1386 +/- ##
=======================================
Coverage 94.25% 94.25%
=======================================
Files 45 45
Lines 4211 4211
=======================================
Hits 3969 3969
Misses 242 242
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you implement the tests using FakeTimers? See our other timeout tests.
@ronag I don't really know how to make it work. This naive doesn't work: if (p === '/timeout300s') {
const clock = FakeTimers.install()
clock.setTimeout(() => {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain')
res.end('text')
}, 300_000)
clock.tick(300_000)
clock.uninstall()
} |
No worries. Let's skip the test then and land this. Can you remove it? |
I didn't commit FakeTimers. PR has tests with regular timers. |
Can you add |
Done |
@ronag It looks like your change is wrong. Fetch uses mocha which requires |
And that's the reason I cannot make FakeTimers work, cause fetch has different testing infrastructure |
* Set fetch timeout to 300 seconds * Update lib/fetch/index.js Co-authored-by: Michaël Zasso <[email protected]> * Add fetch timeout tests * Fix formatting * Skip fetch timeout tests * skip tests * fixup * fixup Co-authored-by: Matteo Collina <[email protected]> Co-authored-by: Michaël Zasso <[email protected]> Co-authored-by: Robert Nagy <[email protected]>
* Set fetch timeout to 300 seconds * Update lib/fetch/index.js Co-authored-by: Michaël Zasso <[email protected]> * Add fetch timeout tests * Fix formatting * Skip fetch timeout tests * skip tests * fixup * fixup Co-authored-by: Matteo Collina <[email protected]> Co-authored-by: Michaël Zasso <[email protected]> Co-authored-by: Robert Nagy <[email protected]>
* Set fetch timeout to 300 seconds * Update lib/fetch/index.js Co-authored-by: Michaël Zasso <[email protected]> * Add fetch timeout tests * Fix formatting * Skip fetch timeout tests * skip tests * fixup * fixup Co-authored-by: Matteo Collina <[email protected]> Co-authored-by: Michaël Zasso <[email protected]> Co-authored-by: Robert Nagy <[email protected]>
No description provided.