-
Notifications
You must be signed in to change notification settings - Fork 73
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
Incompatible with Lolex #23
Comments
Actually, if I replace Lolex with my own implementation, it works. I'm going to file an issue with Lolex instead. Closing this. |
I've only glanced at this but won't this never run because it requires a tick first? https://github.com/timdp/bottleneck-lolex-issue-demo/blob/lolex-mock/index.js#L27
|
@tjenkinson Not with my mock implementation, which only touches |
Cool ok 👍
|
First of all, I'm not sure if this is an issue with Bottleneck or Lolex (used by Sinon to stub
setTimeout
and friends, usually to speed up tests).If I install Lolex and then use Bottleneck to schedule two asynchronous operations, only the first of them will execute; the other one will stay pending. Internally, Bottleneck uses
setTimeout
to schedule, so it looks to me like there's a callback that's not getting executed.I've created a minimal working example. The same thing happens if I use
submit
with a callback instead ofschedule
with a Promise, a well as with Bluebird instead of the native Promise object. Also, the version of Node doesn't seem to matter. Finally, I'm on Windows, but I sure hope that's not the cause.I've tried to dig into the Bottleneck code but wasn't able to come up with anything useful. I did notice that there's only one
clearTimeout
and it doesn't get called when I run my example.Thanks!
The text was updated successfully, but these errors were encountered: