fix: resolve repeatable test suite breakage with ioredis 4.19.0+ #1933
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.
This PR resolves failures in the repeatable job test suite brought about by upgrading
ioredis
to 4.19.0+, as mentioned in the comments for 6fe2928 and #758.The precise change in
ioredis
which yields breakage is the introduction of a new script cleanup helper interval, intended to periodically purge a dictionary used for tracking scripts loaded for the purpose of pipelining. See here, or observe the excerpt below.Nothing is intrinsically wrong with what
ioredis
has done here. We only see breakage within the Bull tests due to a chance interaction with the new cleanup interval, brought about by extremely taxing usage ofsinon
.During the test setup phase,
sinon
is used to spoof timing functions, applying a base time equivalent to the Unix epoch.bull/test/test_repeat.js
Line 21 in dbc08f2
Within some tests, the same
sinon
clock is advanced by massive amounts at once (over 47 years).bull/test/test_repeat.js
Lines 200 to 201 in dbc08f2
These
clock.tick(...)
calls result in a punishing number of executions (around 25 million) of the aforementioned interval. This all takes quite a while, leading to timeouts in the end, and ultimately being the root of test failures.The solution for this thankfully appears to be a simple one: merely swapping out
clock.tick
withclock.setSystemTime
.