Make CacheTest sleep properly

This way it will always sleep for the right amount of time (or longer)
Merge pull request #2742 from ss23/patch-1

Make CacheTest sleep properly