Add tests for TTL feature

Add tests for TTL feature.

Unfortunately, the ttl tests take around 4.5 minutes to run. I tried to use smaller interval in my tests, but this produced unexpected failure due to a too fast or too slow execution.

Excellent catch, I did not realize that was available.