test(integration): poll per-node diagnostics to remove timing fragility (review)
This commit is contained in:
@@ -78,12 +78,23 @@ public sealed class MultiClusterScopingTests
|
||||
}
|
||||
|
||||
// Per-node driver presence: each DriverHostActor spawned ONLY its own cluster's slice.
|
||||
// Poll (rather than single-shot Ask) so transient timing after Sealed doesn't flake.
|
||||
var diagnostics = scope.ServiceProvider.GetRequiredService<IFleetDiagnosticsClient>();
|
||||
|
||||
var mainDrivers = await GetDriverNamesAsync(diagnostics, harness.NodeANodeId);
|
||||
string[] mainDrivers = [];
|
||||
await WaitForAsync(async () =>
|
||||
{
|
||||
mainDrivers = await GetDriverNamesAsync(diagnostics, harness.NodeANodeId);
|
||||
return mainDrivers.SequenceEqual(new[] { MainDriverId });
|
||||
}, TimeSpan.FromSeconds(10));
|
||||
mainDrivers.ShouldBe(new[] { MainDriverId });
|
||||
|
||||
var siteADrivers = await GetDriverNamesAsync(diagnostics, harness.NodeBNodeId);
|
||||
string[] siteADrivers = [];
|
||||
await WaitForAsync(async () =>
|
||||
{
|
||||
siteADrivers = await GetDriverNamesAsync(diagnostics, harness.NodeBNodeId);
|
||||
return siteADrivers.SequenceEqual(new[] { SiteADriverId });
|
||||
}, TimeSpan.FromSeconds(10));
|
||||
siteADrivers.ShouldBe(new[] { SiteADriverId });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user