[Blazor] Reliability improvements for the E2E tests (#15320)

This commit is contained in:
Javier Calvarro Nelson 2019-10-24 18:59:07 +02:00 committed by GitHub
parent 60cb7001ec
commit 4b3054265e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

View File

@ -348,7 +348,6 @@ namespace Ignitor
});
_hubConnection = builder.Build();
await HubConnection.StartAsync(CancellationToken);
HubConnection.On<int, string>("JS.AttachComponent", OnAttachComponent);
HubConnection.On<int, string, string>("JS.BeginInvokeJS", OnBeginInvokeJS);
@ -357,6 +356,8 @@ namespace Ignitor
HubConnection.On<string>("JS.Error", OnError);
HubConnection.Closed += OnClosedAsync;
await HubConnection.StartAsync(CancellationToken);
if (!connectAutomatically)
{
return true;

View File

@ -57,4 +57,10 @@
<Compile Include="$(RepoRoot)src\Shared\Components\ServerComponentMarker.cs" />
</ItemGroup>
<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
using Microsoft.AspNetCore.Components.RenderTree;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.AspNetCore.Testing;
using Microsoft.Extensions.Logging;
using TestServer;
using Xunit;

View File

@ -83,14 +83,14 @@ namespace Microsoft.AspNetCore.Components
return Task.CompletedTask;
}
protected virtual Task DisposeAsync()
protected async virtual Task DisposeAsync()
{
if (TestSink != null)
{
TestSink.MessageLogged -= TestSink_MessageLogged;
}
return Task.CompletedTask;
await Client.DisposeAsync();
}
private void TestSink_MessageLogged(WriteContext context)

View File

@ -0,0 +1,7 @@
{
// This is set to -1 to allow the usage of an
// unlimited ammount of threads.
"maxParallelThreads": -1,
"diagnosticMessages": true,
"longRunningTestSeconds": 30
}