test(session): sample ownership after each non-owner request
This commit is contained in:
@@ -137,16 +137,20 @@ public sealed class SessionDirectoryReplicaTests : IAsyncLifetime
|
||||
session.AddController(controller);
|
||||
await replicaA.OnSessionControllerConnected(session);
|
||||
|
||||
for (var i = 0; i < 6; i++)
|
||||
// The load balancer keeps handing the device's requests to whichever replica it likes, and the
|
||||
// replica without the websocket must never take the session from the one that has it.
|
||||
for (var i = 0; i < 8; i++)
|
||||
{
|
||||
await Request(replicaB, "device-roaming");
|
||||
await Request(replicaA, "device-roaming");
|
||||
await Task.Delay(300, cancellationToken);
|
||||
await Task.Delay(250, cancellationToken);
|
||||
|
||||
var entry = await _directory.GetAsync(session.Id, cancellationToken);
|
||||
Assert.NotNull(entry);
|
||||
Assert.Equal("pod-a", entry.OwnerPod);
|
||||
Assert.True(entry.HoldsConnection);
|
||||
|
||||
await Request(replicaA, "device-roaming");
|
||||
await Task.Delay(50, cancellationToken);
|
||||
}
|
||||
|
||||
var listedByA = await replicaA.GetSessions(_user.Id, null, null, null, false, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user