Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee4540b

Browse files
committed
test: fix DownloaderTest to retry tempdir cleanup
1 parenta58864e commitee4540b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

‎Tests.Vpn.Service/DownloaderTest.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,28 @@ public void Setup()
231231
}
232232

233233
[TearDown]
234-
publicvoidTearDown()
234+
publicasyncTaskTearDown()
235235
{
236-
Directory.Delete(_tempDir,true);
236+
constintmaxAttempts=10;
237+
for(varattempt=1;attempt<=maxAttempts;attempt++)
238+
{
239+
try
240+
{
241+
Directory.Delete(_tempDir,true);
242+
return;
243+
}
244+
catch(IOExceptione)
245+
{
246+
awaitTestContext.Out.WriteLineAsync(
247+
$"failed to delete temp dir (attempt{attempt} of{maxAttempts}):{e.Message}");
248+
if(attempt==maxAttempts)
249+
{
250+
throw;
251+
}
252+
253+
awaitTask.Delay(100);
254+
}
255+
}
237256
}
238257

239258
privatestring_tempDir;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp