Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.44k stars 579 forks source link

Atomically decrease all TTLs #158

Open rightaway opened 4 years ago

rightaway commented 4 years ago

Is your feature request related to a problem? Please describe. I'd like to do integration (or even end to end) testing in an application that uses keydb. 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.

Describe the solution you'd like It would help to have a command 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

silviucpp commented 4 years ago

Why when you compile the app for testing you don't use shorter TTL's ?

This is how we are testing.