[CIFuzz] Fix issue deleting corpus (#5391)

Sometimes deleting the corpus in free_disk_if_needed exceptions.
Pass ignore_errors=True to fix this.
Related: #5383
This commit is contained in:
jonathanmetzman 2021-03-15 09:20:13 -07:00 committed by GitHub
parent 92cea13c5d
commit 5ca736fe00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -156,7 +156,9 @@ class FuzzTarget:
# Delete the seed corpus, corpus, and fuzz target. # Delete the seed corpus, corpus, and fuzz target.
if self.latest_corpus_path and os.path.exists(self.latest_corpus_path): if self.latest_corpus_path and os.path.exists(self.latest_corpus_path):
shutil.rmtree(self.latest_corpus_path) # Use ignore_errors=True to fix
# https://github.com/google/oss-fuzz/issues/5383.
shutil.rmtree(self.latest_corpus_path, ignore_errors=True)
os.remove(self.target_path) os.remove(self.target_path)
target_seed_corpus_path = self.target_path + '_seed_corpus.zip' target_seed_corpus_path = self.target_path + '_seed_corpus.zip'