* Tries to increase the reliability of the tests by: * Trying to ensure that the server is up and running before connecting. * Retrying a connection attempt multiple times.
This commit is contained in:
parent
fdb0372a67
commit
a9d702624a
|
|
@ -359,7 +359,19 @@ namespace Ignitor
|
|||
HubConnection.On<string>("JS.Error", OnError);
|
||||
HubConnection.Closed += OnClosedAsync;
|
||||
|
||||
await HubConnection.StartAsync(CancellationToken);
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
await HubConnection.StartAsync(CancellationToken);
|
||||
break;
|
||||
}
|
||||
catch
|
||||
{
|
||||
await Task.Delay(500);
|
||||
// Retry 10 times
|
||||
}
|
||||
}
|
||||
|
||||
if (!connectAutomatically)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
|
|
@ -22,6 +24,32 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
|
|||
{
|
||||
}
|
||||
|
||||
protected override async Task InitializeAsync()
|
||||
{
|
||||
await base.InitializeAsync();
|
||||
|
||||
var rootUri = ServerFixture.RootUri;
|
||||
var baseUri = new Uri(rootUri, "/subdir");
|
||||
var client = new HttpClient();
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await client.GetAsync(baseUri + "/_negotiate");
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
await Task.Delay(500);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19414")]
|
||||
public async Task CannotStartMultipleCircuits()
|
||||
|
|
|
|||
Loading…
Reference in New Issue