Skip to content

Commit

Permalink
Check if SLDR cache exists before clearing it out
Browse files Browse the repository at this point in the history
This fixes some further test flakiness I saw locally.
  • Loading branch information
josephmyers committed Sep 12, 2024
1 parent a4f5491 commit f134e91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SIL.WritingSystems.Tests/SldrTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public void Dispose()
Sldr.Cleanup();
// clear out SLDR cache
var di = new DirectoryInfo(sldrCachePath);
foreach (var fi in di.GetFiles())
fi.Delete();
if (di.Exists)
foreach (var fi in di.GetFiles())
fi.Delete();
// The OfflineSldrAttribute has been assigned to the entire test assembly, so we reinitialize
// the SLDR back to what it was
Sldr.Initialize(true, sldrCachePath);
Expand Down

0 comments on commit f134e91

Please sign in to comment.