Retry on analyzer reference assembly failure (#889)
This commit is contained in:
Родитель
5c3f79f2e4
Коммит
96b56eae03
|
@ -20,7 +20,7 @@
|
|||
<FullBlobPath>$(BlobBase)$(IndexName)</FullBlobPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<DownloadFile SourceUrl="$(FullBlobPath)" DestinationFolder=".data">
|
||||
<DownloadFile SourceUrl="$(FullBlobPath)" DestinationFolder=".data" Retries="3">
|
||||
<Output TaskParameter="DownloadedFile" ItemName="TheFile" />
|
||||
</DownloadFile>
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit">
|
||||
<Version>1.0.1-beta1.21265.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Polly" Version="7.2.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj" />
|
||||
|
|
|
@ -15,6 +15,7 @@ using Microsoft.CodeAnalysis.Diagnostics;
|
|||
using Microsoft.CodeAnalysis.Testing;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Steps.Source;
|
||||
using Polly;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test
|
||||
|
@ -82,7 +83,9 @@ namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test
|
|||
}
|
||||
}
|
||||
|
||||
var references = await GetReferenceAssemblies().ResolveAsync(language.ToLanguageName(), cancellationToken);
|
||||
var references = await Policy.Handle<Exception>()
|
||||
.RetryAsync(3)
|
||||
.ExecuteAsync(cancellationToken => GetReferenceAssemblies().ResolveAsync(language.ToLanguageName(), cancellationToken), cancellationToken);
|
||||
|
||||
project = project.WithMetadataReferences(references);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче