We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a58864e commit ee4540bCopy full SHA for ee4540b
Tests.Vpn.Service/DownloaderTest.cs
@@ -231,9 +231,28 @@ public void Setup()
231
}
232
233
[TearDown]
234
- public void TearDown()
+ public async Task TearDown()
235
{
236
- Directory.Delete(_tempDir, true);
+ const int maxAttempts = 10;
237
+ for (var attempt = 1; attempt <= maxAttempts; attempt++)
238
+ {
239
+ try
240
241
+ Directory.Delete(_tempDir, true);
242
+ return;
243
+ }
244
+ catch (IOException e)
245
246
+ await TestContext.Out.WriteLineAsync(
247
+ $"failed to delete temp dir (attempt {attempt} of {maxAttempts}): {e.Message}");
248
+ if (attempt == maxAttempts)
249
250
+ throw;
251
252
+
253
+ await Task.Delay(100);
254
255
256
257
258
private string _tempDir;
0 commit comments