Skip to content

Commit

Permalink
fix shouldbootandthenclose test
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam committed Jul 14, 2021
1 parent 36bfafc commit c10a3c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/Nakama.Tests/Socket/WebSocketPartyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ public async Task PresencesInitializedWithConcurrentJoins()

while (partyObjCounter < numMembers)
{
System.Console.WriteLine(partyObjCounter);
await Task.Delay(25);
}

Expand Down Expand Up @@ -358,9 +357,11 @@ public async Task ShouldBootThenClose()
var socket2PresenceTcs = new TaskCompletionSource<IUserPresence>();

socket1.ReceivedPartyPresence += presences => {
if (!socket2PresenceTcs.Task.IsCompleted)

var session2Join = presences.Joins.FirstOrDefault(presence => presence.UserId == session2.UserId);
if (session2Join != null)
{
socket2PresenceTcs.SetResult(presences.Joins.FirstOrDefault(presence => presence.UserId == session2.UserId));
socket2PresenceTcs.SetResult(session2Join);
}
};

Expand Down

0 comments on commit c10a3c5

Please sign in to comment.