diff --git a/src/ProjectTemplates/test/BlazorServerTemplateTest.cs b/src/ProjectTemplates/test/BlazorServerTemplateTest.cs
index bf9fe12f2c..463b710ac3 100644
--- a/src/ProjectTemplates/test/BlazorServerTemplateTest.cs
+++ b/src/ProjectTemplates/test/BlazorServerTemplateTest.cs
@@ -36,7 +36,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
@@ -93,7 +93,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/EmptyWebTemplateTest.cs b/src/ProjectTemplates/test/EmptyWebTemplateTest.cs
index 64f5d8cf3e..56e2e8c105 100644
--- a/src/ProjectTemplates/test/EmptyWebTemplateTest.cs
+++ b/src/ProjectTemplates/test/EmptyWebTemplateTest.cs
@@ -22,10 +22,19 @@ namespace Templates.Test
public ITestOutputHelper Output { get; }
- [Theory]
- [InlineData(null)]
- [InlineData("F#")]
- public async Task EmptyWebTemplateAsync(string languageOverride)
+ [Fact]
+ public async Task EmptyWebTemplateCSharp()
+ {
+ await EmtpyTemplateCore(languageOverride: null);
+ }
+
+ [Fact]
+ public async Task EmptyWebTemplateFSharp()
+ {
+ await EmtpyTemplateCore("F#");
+ }
+
+ private async Task EmtpyTemplateCore(string languageOverride)
{
Project = await ProjectFactory.GetOrCreateProject("empty" + (languageOverride == "F#" ? "fsharp" : "csharp"), Output);
@@ -36,7 +45,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/Helpers/AspNetProcess.cs b/src/ProjectTemplates/test/Helpers/AspNetProcess.cs
index cb071dc8f3..deb0c199d2 100644
--- a/src/ProjectTemplates/test/Helpers/AspNetProcess.cs
+++ b/src/ProjectTemplates/test/Helpers/AspNetProcess.cs
@@ -58,7 +58,7 @@ namespace Templates.Test.Helpers
var arguments = published ? $"exec {dllPath}" : "run";
Process = ProcessEx.Run(output, workingDirectory, DotNetMuxer.MuxerPathOrDefault(), arguments, envVars: environmentVariables);
- if(hasListeningUri)
+ if (hasListeningUri)
{
ListeningUri = GetListeningUri(output);
}
@@ -108,7 +108,7 @@ namespace Templates.Test.Helpers
HttpMethod.Get,
new Uri(ListeningUri, page.Url));
- var response = await _httpClient.SendAsync(request);
+ var response = await RequestWithRetries(client => client.SendAsync(request), _httpClient);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var parser = new HtmlParser();
@@ -141,7 +141,7 @@ namespace Templates.Test.Helpers
Assert.True(string.Equals(anchor.Href, expectedLink), $"Expected next link to be {expectedLink} but it was {anchor.Href}.");
var result = await RetryHelper.RetryRequest(async () =>
{
- return await _httpClient.GetAsync(anchor.Href);
+ return await RequestWithRetries(client => client.GetAsync(anchor.Href), _httpClient);
}, logger: NullLogger.Instance);
Assert.True(IsSuccessStatusCode(result), $"{anchor.Href} is a broken link!");
@@ -149,6 +149,28 @@ namespace Templates.Test.Helpers
}
}
+ private async Task
RequestWithRetries(Func> requester, HttpClient client, int retries = 3, TimeSpan initialDelay = default)
+ {
+ var currentDelay = initialDelay == default ? TimeSpan.FromSeconds(30) : initialDelay;
+ for (int i = 0; i <= retries; i++)
+ {
+ try
+ {
+ return await requester(client);
+ }
+ catch (Exception)
+ {
+ if (i == retries)
+ {
+ throw;
+ }
+ await Task.Delay(currentDelay);
+ currentDelay *= 2;
+ }
+ }
+ throw new InvalidOperationException("Max retries reached.");
+ }
+
private Uri GetListeningUri(ITestOutputHelper output)
{
// Wait until the app is accepting HTTP requests
@@ -190,7 +212,7 @@ namespace Templates.Test.Helpers
internal Task SendRequest(string path)
{
- return _httpClient.GetAsync(new Uri(ListeningUri, path));
+ return RequestWithRetries(client => client.GetAsync(new Uri(ListeningUri, path)), _httpClient);
}
public async Task AssertStatusCode(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null)
@@ -204,7 +226,7 @@ namespace Templates.Test.Helpers
request.Headers.Add("Accept", acceptContentType);
}
- var response = await _httpClient.SendAsync(request);
+ var response = await RequestWithRetries(client => client.SendAsync(request), _httpClient);
Assert.True(statusCode == response.StatusCode, $"Expected {requestUrl} to have status '{statusCode}' but it was '{response.StatusCode}'.");
}
diff --git a/src/ProjectTemplates/test/IdentityUIPackageTest.cs b/src/ProjectTemplates/test/IdentityUIPackageTest.cs
index 204c560859..deede64521 100644
--- a/src/ProjectTemplates/test/IdentityUIPackageTest.cs
+++ b/src/ProjectTemplates/test/IdentityUIPackageTest.cs
@@ -134,7 +134,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync(packageOptions: packageOptions);
diff --git a/src/ProjectTemplates/test/MvcTemplateTest.cs b/src/ProjectTemplates/test/MvcTemplateTest.cs
index 95f6ce784a..9ebaf1afc6 100644
--- a/src/ProjectTemplates/test/MvcTemplateTest.cs
+++ b/src/ProjectTemplates/test/MvcTemplateTest.cs
@@ -25,11 +25,14 @@ namespace Templates.Test
public ProjectFactoryFixture ProjectFactory { get; }
public ITestOutputHelper Output { get; }
- [Theory]
- [InlineData(null)]
- [InlineData("F#")]
- [Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.All)]
- public async Task MvcTemplate_NoAuthImplAsync(string languageOverride)
+ [Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/14022")]
+ public async Task MvcTemplate_NoAuthFSharp() => await MvcTemplateCore(languageOverride: "F#");
+
+ [Fact]
+ public async Task MvcTemplate_NoAuthCSharp() => await MvcTemplateCore(languageOverride: null);
+
+
+ private async Task MvcTemplateCore(string languageOverride)
{
Project = await ProjectFactory.GetOrCreateProject("mvcnoauth" + (languageOverride == "F#" ? "fsharp" : "csharp"), Output);
@@ -48,7 +51,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
@@ -98,8 +101,7 @@ namespace Templates.Test
[Theory]
[InlineData(true)]
[InlineData(false)]
- [Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2267", FlakyOn.All)]
- public async Task MvcTemplate_IndividualAuthImplAsync(bool useLocalDB)
+ public async Task MvcTemplate_IndividualAuth(bool useLocalDB)
{
Project = await ProjectFactory.GetOrCreateProject("mvcindividual" + (useLocalDB ? "uld" : ""), Output);
@@ -116,7 +118,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs
index 8186ab4156..0d02a56f8f 100644
--- a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs
+++ b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs
@@ -33,7 +33,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
@@ -52,7 +52,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs
index 637d7179b5..7cd41d56b2 100644
--- a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs
+++ b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs
@@ -26,8 +26,7 @@ namespace Templates.Test
public ITestOutputHelper Output { get; }
[Fact]
- [Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2327", FlakyOn.All)]
- public async Task RazorPagesTemplate_NoAuthImplAsync()
+ public async Task RazorPagesTemplate_NoAuth()
{
Project = await ProjectFactory.GetOrCreateProject("razorpagesnoauth", Output);
@@ -45,7 +44,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, createResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
@@ -95,10 +94,9 @@ namespace Templates.Test
}
[Theory]
- [Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2335", FlakyOn.All)]
[InlineData(false)]
[InlineData(true)]
- public async Task RazorPagesTemplate_IndividualAuthImplAsync(bool useLocalDB)
+ public async Task RazorPagesTemplate_IndividualAuth(bool useLocalDB)
{
Project = await ProjectFactory.GetOrCreateProject("razorpagesindividual" + (useLocalDB ? "uld" : ""), Output);
@@ -115,7 +113,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs
index 700349b773..1826b5a4eb 100644
--- a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs
+++ b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs
@@ -76,7 +76,7 @@ namespace Templates.Test.SpaTemplateTest
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
using var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/WebApiTemplateTest.cs b/src/ProjectTemplates/test/WebApiTemplateTest.cs
index 8e08db9068..89d047a06e 100644
--- a/src/ProjectTemplates/test/WebApiTemplateTest.cs
+++ b/src/ProjectTemplates/test/WebApiTemplateTest.cs
@@ -22,10 +22,13 @@ namespace Templates.Test
public Project Project { get; set; }
- [Theory]
- [InlineData(null)]
- [InlineData("F#")]
- public async Task WebApiTemplateAsync(string languageOverride)
+ [Fact]
+ public async Task WebApiTemplateFSharp() => await WebApiTemplateCore(languageOverride: "F#");
+
+ [Fact]
+ public async Task WebApiTemplateCSharp() => await WebApiTemplateCore(languageOverride: null);
+
+ private async Task WebApiTemplateCore(string languageOverride)
{
Project = await FactoryFixture.GetOrCreateProject("webapi" + (languageOverride == "F#" ? "fsharp" : "csharp"), Output);
@@ -36,7 +39,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/ProjectTemplates/test/WorkerTemplateTest.cs b/src/ProjectTemplates/test/WorkerTemplateTest.cs
index fbe88be770..738eafc61d 100644
--- a/src/ProjectTemplates/test/WorkerTemplateTest.cs
+++ b/src/ProjectTemplates/test/WorkerTemplateTest.cs
@@ -32,7 +32,7 @@ namespace Templates.Test
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult));
// Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release
- // The output from publish will go into bin/Release/netcoreapp3.1/publish and won't be affected by calling build
+ // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build
// later, while the opposite is not true.
var buildResult = await Project.RunDotNetBuildAsync();
diff --git a/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs b/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs
index 4206ab8f22..e408a22b69 100644
--- a/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs
+++ b/src/Servers/IIS/IntegrationTesting.IIS/src/IISExpressDeployer.cs
@@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
// Start timer
StartTimer();
- // For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/netcoreapp3.1/
+ // For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/netcoreappX.Y/
// and contentRoot points to the project directory so you get things like static assets.
// For a published app both point to the publish directory.
var dllRoot = CheckIfPublishIsRequired();
diff --git a/src/SignalR/common/Http.Connections/src/Internal/Transports/WebSocketsServerTransport.cs b/src/SignalR/common/Http.Connections/src/Internal/Transports/WebSocketsServerTransport.cs
index ef54b75288..d5c2c1fefb 100644
--- a/src/SignalR/common/Http.Connections/src/Internal/Transports/WebSocketsServerTransport.cs
+++ b/src/SignalR/common/Http.Connections/src/Internal/Transports/WebSocketsServerTransport.cs
@@ -155,7 +155,8 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal.Transports
var memory = _application.Output.GetMemory();
var receiveResult = await socket.ReceiveAsync(memory, token);
- // Need to check again for netcoreapp3.1 because a close can happen between a 0-byte read and the actual read
+
+ // Need to check again for netcoreapp3.0 and later because a close can happen between a 0-byte read and the actual read
if (receiveResult.MessageType == WebSocketMessageType.Close)
{
return;
diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs
index a75f78abe1..e4a17878fc 100644
--- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs
+++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddFileTests.cs
@@ -134,7 +134,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
Assert.Single(openApiRefs);
}
- [Fact (Skip = "https://github.com/aspnet/AspNetCore/pull/13571/#issuecomment-531466801")]
+ [Fact]
public async Task OpenApi_Add_NSwagTypeScript()
{
var project = CreateBasicProject(withOpenApi: true);
@@ -155,20 +155,9 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
Assert.Contains("", content);
}
-
- // Build project and make sure it compiles
- using var buildProc = ProcessEx.Run(_outputHelper, _tempDir.Root, "dotnet", "build");
- await buildProc.Exited;
- Assert.True(buildProc.ExitCode == 0, $"Build failed: {buildProc.Output}");
-
-
- // Run project and make sure it doesn't crash
- using var runProc = ProcessEx.Run(_outputHelper, _tempDir.Root, "dotnet", "run");
- Thread.Sleep(100);
- Assert.False(runProc.HasExited, $"Run failed with: {runProc.Output}");
}
- [Fact (Skip = "https://github.com/aspnet/AspNetCore/pull/13571/#issuecomment-531466801")]
+ [Fact]
public async Task OpenApi_Add_FromJson()
{
var project = CreateBasicProject(withOpenApi: true);
@@ -189,16 +178,6 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
Assert.Contains("