From 948142214f24c0b2db485e9246b73f18be43cf49 Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Sat, 30 Jul 2022 01:04:11 -0600 Subject: [PATCH] Add retry to symlink test (#73042) --- .../tests/PhysicalFileProviderTests.netcoreapp.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs index 633e722..34fab62 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.netcoreapp.cs @@ -107,7 +107,11 @@ namespace Microsoft.Extensions.FileProviders // Act - Change link target to file 2. File.Delete(linkPath); - File.CreateSymbolicLink(linkPath, file2Path); + + RetryHelper.Execute(() => + { + File.CreateSymbolicLink(linkPath, file2Path); // can fail, presumably due to some latency of delete of linkPath + }, maxAttempts: 10, retryWhen: e => e is UnauthorizedAccessException); // Assert - It should report the change regardless of the timestamp being older. Assert.True(await tcs.Task, -- 2.7.4