Open download13 opened 10 years ago
More generally, I'm looking to help improve this library a bit so I can use it for a project, but it seems like there's some test problems right now. A bunch of tests fail on my system and Travis doesn't seem to be handling it all that well either.
Would anyone mind if I went through and tried to clean it out? At least to the point where the tests reliably pass on Travis.
Please go ahead. I'll review and accept PRs ASAP.
On Saturday, August 9, 2014, Erin Dachtler notifications@github.com wrote:
More generally, I'm looking to help improve this library a bit so I can use it for a project, but it seems like there's some test problems right now. A bunch of tests fail on my system and Travis doesn't seem to be handling it all that well either.
Would anyone mind if I went through and tried to clean it out? At least to the point where the tests reliably pass on Travis.
— Reply to this email directly or view it on GitHub https://github.com/faeldt/redis-mock/issues/30#issuecomment-51661179.
+1 Redis itself uses a lazy timer system @download13 What is the status on this ... I was thinking of doing the exact same thing.
Currently I just scan all the keys and clear all the _expire timeouts after the test, but deleted keys cause problems since they don't clear timeouts on DEL.
Interim solution, clear timeouts on DEL and FLUSHDB: #48
The method used for expiring values seems to be causing some issues. A lot of care must be taken to make things like setInteval and setTimeout not cause problems with the fake timers provided by sinon.
I propose a change to a lazy expiration system. It should solve the problems with sinon, and the problem of values living up to 100 milliseconds after they were supposed to expire. Plus it would allow the deletion of a large chunk of complicated code from the
RedisMock
constructor.I can send a pull request if nobody else wants to do it just now.