Index: tools/isolate/run_test_from_archive.py |
diff --git a/tools/isolate/run_test_from_archive.py b/tools/isolate/run_test_from_archive.py |
index 13ded87aa6f0b82832013369609d40c169ecc6f0..8d304e681b07df5e6e18d6c912f4776005a9fb34 100755 |
--- a/tools/isolate/run_test_from_archive.py |
+++ b/tools/isolate/run_test_from_archive.py |
@@ -175,6 +175,11 @@ class Cache(object): |
def trim(self): |
"""Trims anything we don't know, make sure enough free space exists.""" |
+ # Ensure that all files listed in the state still exist. |
+ for f in self.state: |
+ if not os.path.exists(os.path.join(self.cache_dir, f)): |
+ self.state.remove(f) |
+ |
for f in os.listdir(self.cache_dir): |
if f == self.STATE_FILE or f in self.state: |
continue |