[Blazor] Reliability improvements for the E2E tests (#15320)
This commit is contained in:
parent
60cb7001ec
commit
4b3054265e
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in New Issue