Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: tools/isolate/run_test_from_archive.py

Issue 10382239: Cleanup Cache Stored State (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698