test(integration): harden B8 live assertions (ArchestrAUserToId user_id, bootstrap arrival, split guard)

Fix 1 (Important): assert ArchestrAUserToId Ok-path payload carries a non-zero user_id, mirroring the AuthenticateUser pattern.
Fix 2 (Important): assert bootstrapBufferedEvents > 0 before the residual return so the "empty NoData bootstrap arrives" claim is verified, not just assumed.
Fix 3 (Minor): change SplitLiveItemForBuffered guard from lastDot <= 0 to lastDot < 0 so a leading-dot reference ".TestInt" (lastDot==0) is not mis-handled as undotted.
This commit is contained in:
Joseph Doherty
2026-06-15 11:30:15 -04:00
parent efd99718d7
commit f7ada90359
@@ -660,6 +660,14 @@ public sealed class WorkerLiveMxAccessSmokeTests(ITestOutputHelper output)
Assert.True( Assert.True(
userToIdReply.ProtocolStatus.Code is ProtocolStatusCode.Ok or ProtocolStatusCode.MxaccessFailure, userToIdReply.ProtocolStatus.Code is ProtocolStatusCode.Ok or ProtocolStatusCode.MxaccessFailure,
$"ArchestrAUserToId must surface a real MXAccess outcome, got {userToIdReply.ProtocolStatus.Code}."); $"ArchestrAUserToId must surface a real MXAccess outcome, got {userToIdReply.ProtocolStatus.Code}.");
if (userToIdReply.ProtocolStatus.Code == ProtocolStatusCode.Ok)
{
// On the dev rig ArchestrAUserToId with a valid GUID resolves to user_id=1.
// Don't pin the exact id (provider-dependent) — just prove the Ok path carried
// a usable non-zero ArchestrA user id through the reply payload.
Assert.NotNull(userToIdReply.ArchestraUserToId);
Assert.NotEqual(0, userToIdReply.ArchestraUserToId.UserId);
}
// Suspend / Activate against the advised item. The dev-rig TestInt item class // Suspend / Activate against the advised item. The dev-rig TestInt item class
// may not be suspendable (MXAccess returns 0x80070057 / E_INVALIDARG for a // may not be suspendable (MXAccess returns 0x80070057 / E_INVALIDARG for a
@@ -848,6 +856,13 @@ public sealed class WorkerLiveMxAccessSmokeTests(ITestOutputHelper output)
+ $"was observed within {IntegrationTestEnvironment.LiveMxAccessEventTimeout}. Live " + $"was observed within {IntegrationTestEnvironment.LiveMxAccessEventTimeout}. Live "
+ "§3.2 multi-sample conversion remains unverified (rig object logic may not drive " + "§3.2 multi-sample conversion remains unverified (rig object logic may not drive "
+ "buffered samples on demand)."); + "buffered samples on demand).");
// The residual claim ("empty NoData bootstrap arrives and converts without crashing")
// is only meaningful if at least one OnBufferedDataChange event arrived. Assert that
// the buffered subscription registered and the worker's event plumbing fired at all.
Assert.True(
bootstrapBufferedEvents > 0,
"No OnBufferedDataChange event arrived at all after Advise; the buffered subscription may not have registered.");
return; return;
} }
@@ -1416,7 +1431,7 @@ public sealed class WorkerLiveMxAccessSmokeTests(ITestOutputHelper output)
private static (string Item, string Context) SplitLiveItemForBuffered(string liveItem) private static (string Item, string Context) SplitLiveItemForBuffered(string liveItem)
{ {
int lastDot = liveItem.LastIndexOf('.'); int lastDot = liveItem.LastIndexOf('.');
if (lastDot <= 0 || lastDot >= liveItem.Length - 1) if (lastDot < 0 || lastDot >= liveItem.Length - 1)
{ {
return (liveItem, string.Empty); return (liveItem, string.Empty);
} }