mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-20 20:43:47 +01:00
Mitigate a race condition
This commit is contained in:
@@ -264,8 +264,10 @@ namespace Tgstation.Server.Tests.Live
|
||||
var result = await client.RunOperation(gql => gql.ListUsers.ExecuteAsync(cancellationToken), cancellationToken);
|
||||
result.EnsureNoErrors();
|
||||
var users = result.Data.Swarm.Users.QueryableUsers;
|
||||
Assert.IsTrue(users.TotalCount > 0);
|
||||
Assert.AreEqual(Math.Min(ApiController.DefaultPageSize, users.TotalCount), users.Nodes.Count);
|
||||
Assert.IsTrue(users.Nodes.Count > 0);
|
||||
// Can't assert this, there's a race condition
|
||||
// Assert.AreEqual(Math.Min(ApiController.DefaultPageSize, users.TotalCount), users.Nodes.Count);
|
||||
Assert.IsTrue(Math.Min(ApiController.DefaultPageSize, users.TotalCount) >= users.Nodes.Count);
|
||||
|
||||
var tgsUserResult = await client.RunOperation(gql => gql.GetUserNameByNodeId.ExecuteAsync(gqlUser.Swarm.Users.Current.CreatedBy.Id, cancellationToken), cancellationToken);
|
||||
tgsUserResult.EnsureNoErrors();
|
||||
|
||||
Reference in New Issue
Block a user