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 633e722702687c..34fab6206c2c18 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 @@ public async Task UsePollingFileWatcher_UseActivePolling_HasChanged_SymbolicLink // 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,