-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow passing Infinity
to waitFor
as timeout
#3215
Conversation
🦋 Changeset detectedLatest commit: 1d6fc62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodeSee Review Map:Review in an interactive map View more CodeSee Maps Legend |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1d6fc62:
|
rej(new Error(`Timeout of ${resolvedOptions.timeout} ms exceeded`)); | ||
}, resolvedOptions.timeout); | ||
const handle = | ||
resolvedOptions.timeout === Infinity |
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.
do you perhaps have a link that would mention the valid max value for this? It seems that Number.MAX_SAFE_INTEGER
also calls this immediately
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.
I read that it's implemented using a 32bit unsigned int in most browsers, assumed that the max value was un-specced.
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.
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.
I wonder if, in the next major version, the Infinity
shouldn't be the default. cc @davidkpiano
It seems to be less quirky to configure an explicit timeout manually than to disable the builtin one.
Infinity
to as waitFor
timeoutInfinity
to waitFor
as timeout
You could create a |
* Allow passing `Infinity` to as `waitFor` timeout * Add changeset * Add dev warning for negative timeouts Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com> * Format * Add test * Simplify casting situation in `waitFor` * Update .changeset/cool-ducks-pretend.md Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Closes #3214
WIP for now as I need figure out how to write a test for this, any pointers?