Added a test for the cache file race condition

this can occur when loading metadata from an incomplete cache file