Closed 2hu12 closed 9 years ago
Yup, there was a race condition, thanks
@rnsloan does this fix your throttle solution?
@kolodny I have tested the solution provided in the solutions
branch against the latest test (with the clock.tick
additions) and it is now passing in my environment: iojs v2.2.1 .
@kolodny as an aside, I have noticed that underscore's throttle method fails this test in my environment around 20%-30% of the time
1) throttle will execute every threshold ms:
AssertionError: [ 0, 10, 21, 32, 43, 54 ] deepEqual [ 0, 11, 22, 33, 44, 55 ]
+ expected - actual
[
0
- 10
- 21
- 32
- 43
- 54
- 65
+ 11
+ 22
+ 33
+ 44
+ 55
]
hmm, maybe I should allow a fudge factor then
Fix 'throttle' a proper timeout of the 'will execute every threshold ms' test case.