Use custom group names in tests to not collide with other tests running (#2102)

This commit is contained in:
BrennanConroy 2018-04-20 09:26:26 -07:00 committed by GitHub
parent 1e65802109
commit e6011ef69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -78,11 +78,13 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Tests
var tcs2 = new TaskCompletionSource<string>();
secondConnection.On<string>("Echo", message => tcs2.TrySetResult(message));
var groupName = $"TestGroup_{transportType}_{protocolName}_{Guid.NewGuid()}";
await secondConnection.StartAsync().OrTimeout();
await connection.StartAsync().OrTimeout();
await connection.InvokeAsync("AddSelfToGroup", "Test").OrTimeout();
await secondConnection.InvokeAsync("AddSelfToGroup", "Test").OrTimeout();
await connection.InvokeAsync("EchoGroup", "Test", "Hello, World!").OrTimeout();
await connection.InvokeAsync("AddSelfToGroup", groupName).OrTimeout();
await secondConnection.InvokeAsync("AddSelfToGroup", groupName).OrTimeout();
await connection.InvokeAsync("EchoGroup", groupName, "Hello, World!").OrTimeout();
Assert.Equal("Hello, World!", await tcs.Task.OrTimeout());
Assert.Equal("Hello, World!", await tcs2.Task.OrTimeout());