add dispatch unit tests and minor refactoring#602
Merged
Conversation
🦋 Changeset detectedLatest commit: 31ccfd7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
862dd37 to
36fff04
Compare
36fff04 to
d8c716c
Compare
210cbeb to
522e62c
Compare
522e62c to
e1da2c3
Compare
a1a33fa to
9976fab
Compare
22ecabd to
8ddc550
Compare
silesky
commented
Sep 26, 2022
| }) | ||
|
|
||
| // TODO: Inconsistent behavior? This seems like a bug. | ||
| it('should have inconsistent timeout behavior where the delay is different based on whether timeout is explicitly set to 1000 or not', async () => { |
Contributor
There was a problem hiding this comment.
I think this is intentional, 300ms default, but it is configurable.
pooyaj
approved these changes
Sep 26, 2022
| Math.max((timeoutInMs ?? 300) - elapsedTime, 0), | ||
| timeoutInMs | ||
| getDelay(startTime, options.timeout), // TODO: I have no idea why this delay is based on the timeout -- so if you set a timeout of 5seconds, it will (in addition) actually delay ~5seconds before invoking. | ||
| options.timeout |
Contributor
There was a problem hiding this comment.
I think that makes sense. So normally 300ms timeout, but let user configure the value to whatever they want?
| }) | ||
|
|
||
| // TODO: Inconsistent behavior? This seems like a bug. | ||
| it('should have inconsistent timeout behavior where the delay is different based on whether timeout is explicitly set to 1000 or not', async () => { |
Contributor
There was a problem hiding this comment.
I think this is intentional, 300ms default, but it is configurable.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There were no unit tests covering dispatch, so I needed to add some to sleep at night, (and also because it seems a fairly importanish part of core). In doing so, uncovered weird behavior -- would like clarity on it.