diff --git a/test/Templates.Test/Helpers/AspNetProcess.cs b/test/Templates.Test/Helpers/AspNetProcess.cs index 268383f09f..0aab347cd4 100644 --- a/test/Templates.Test/Helpers/AspNetProcess.cs +++ b/test/Templates.Test/Helpers/AspNetProcess.cs @@ -8,7 +8,6 @@ using System.Net.Http; using Microsoft.Extensions.CommandLineUtils; using Xunit; using Xunit.Abstractions; -using System.Threading; namespace Templates.Test.Helpers { @@ -108,31 +107,6 @@ namespace Templates.Test.Helpers Assert.Equal(statusCode, response.StatusCode); } - public void AssertStatusCodeWithRetry(string requestUrl, HttpStatusCode statusCode, string acceptContentType = null) - { - const int MaxAttempts = 3; - - for (var attemptNumber = 1; ; attemptNumber++) - { - try - { - AssertStatusCode(requestUrl, statusCode, acceptContentType); - return; - } - catch - { - if (attemptNumber >= MaxAttempts) - { - _output.WriteLine($"Giving up requesting '{requestUrl}' after {attemptNumber} attempts."); - throw; - } - - _output.WriteLine($"Request to '{requestUrl}' failed, but will retry..."); - Thread.Sleep(3000); - } - } - } - public IWebDriver VisitInBrowser() { _output.WriteLine($"Opening browser at {_listeningUri}..."); diff --git a/test/Templates.Test/SpaTemplateTest.cs b/test/Templates.Test/SpaTemplateTest.cs index 0fcf506d9e..3b98fa6479 100644 --- a/test/Templates.Test/SpaTemplateTest.cs +++ b/test/Templates.Test/SpaTemplateTest.cs @@ -46,11 +46,7 @@ namespace Templates.Test { using (var aspNetProcess = StartAspNetProcess(targetFrameworkOverride, publish)) { - // TODO: Remove the retry from here. Instead, work around the issue in the actual - // SpaServices.Extensions code (by retrying). The issue is that @angular/cli rejects - // connections for the first second or so after it claims to be listening. - // However, you do still need to keep sending "Accept: text/html" or it returns 404. - aspNetProcess.AssertStatusCodeWithRetry("/", HttpStatusCode.OK, "text/html"); + aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); if (WebDriverFactory.HostSupportsBrowserAutomation) {