Skip to content

Commit 0ed5f63

Browse files
committed
review: the three timeouts in the test overlap
1 parent 1c865b8 commit 0ed5f63

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

dotnet/EcencyApi.Tests/HiveRpcFailoverTests.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,12 @@ public async Task AHealthyNodeWithOverlappingTimeouts_IsNotParked()
362362
{
363363
await client.Call("condenser_api", "get_accounts", new JsonArray());
364364
}
365-
// Three overlapping timeouts (sequential here is the strictest form of
366-
// "consecutive"; the stub's single-threaded loop makes them serial).
365+
// Three overlapping timeouts: the calls start together, each holding an
366+
// ordering with the busy node first, and all three fail on it at the
367+
// same time before failing over to the spare.
367368
hang = true;
368-
for (var i = 0; i < 3; i++)
369-
{
370-
now += 31_000; // past the recent-failure demotion, so it is retried
371-
await client.Call("condenser_api", "get_accounts", new JsonArray());
372-
}
369+
await Task.WhenAll(Enumerable.Range(0, 3)
370+
.Select(_ => client.Call("condenser_api", "get_accounts", new JsonArray())));
373371
hang = false;
374372
var view = client.HealthSnapshot()[0]!;
375373
Assert.Equal(3, view["consecutive_failures"]!.GetValue<int>());

0 commit comments

Comments
 (0)