test(integration): poll per-node diagnostics to remove timing fragility (review)

This commit is contained in:
Joseph Doherty
2026-06-07 03:37:04 -04:00
parent b88ae5db10
commit e4a3f07c99
@@ -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 });
}