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

fix: Added a second timeout(1) to force spinning again the event loop lap … #34

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

javiersigler
Copy link

…and verify if the initial operation has been successful

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Based on the work of Jeremy Martin: https://github.com/jmar777/cb
Added a second timeout(1) to force spinning again the event loop lap and verify if the initial operation has been successful

References

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

…and verify if the initial operation has been successful
@javiersigler javiersigler requested review from pmalouin and a team May 9, 2022 13:21
cb(new TimeoutError(ms));
timedout = true;
}, 1);
}, ms - 1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every millisecond matters :)


it('should complete with an error after timeout period', function(done) {
invokeAsync(cb(function(err, res) {
assert(err);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that we should check that the error expected is this one [1] otherwise this could get confused with the TimeoutError....

[1] https://github.com/auth0/limitd-redis/pull/34/files#diff-deb070fad931387cd42a3dcf866f39ebc8832e9d0196e80a3ea740563263a1e1R12

@javiersigler javiersigler merged commit 6f06372 into master Jun 3, 2022
@javiersigler javiersigler deleted the fix_spinning_again_event_loop_lap branch June 3, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants