Changing the test so it clears the cache from time to time.

This is currently leading to two problems: either a memory access violation or a deadlock.