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
Atomically decrease all TTLs #5972
Comments
Could we introduce a client flag (for TTL_SIMULATE) & a field (how much to scale down the TTL) which we could then check in SetGenericCommand? (Apologies in advance for mistakes, I am very newly joining the contribution community) |
This seems kind of bloat/creep-ish to add to redis core. I realize this may not be a feasible option for you, but just a random thought: Maybe you can parameterize your TTL values in your application so you can specify arbitrary lower values for your unit tests? |
Or, you could set the server's clock via the OS to a time in the future instead. |
@itamarhaber That would break a lot of other expected and unexpected things. It's not a good idea to just change a server's time. |
I'd like to do integration (or even end to end) testing in an application that uses redis. But to do that I need to test certain keys before and after their TTL goes to 0, but of course I can't have a test wait an hour for a particular key with a one hour TTL to expire.
It would help to have a command in redis to simulate skipping the time ahead, something like
TIME -3600
to atomically decrease all TTLs by an hour. I'm currently using unit testing but this feature would allow me to do integration testing to really ensure application robustness.The text was updated successfully, but these errors were encountered: