Skip to content

Commit 3db6e5f

Browse files
KSemenenkoclaude
andcommitted
Fix three cluster oracles that the shortened lanes never reached
With the 45-minute lane deadline, I07 lane 2 and I09 ran classes that had been cut off before: - AcSqlView005: the stream record expected event sequence 1, but the sequence counts every event in the partition; the oracle now uses the sequence the original model row reported. - LeftFilteredJoin: the unified SQL tool compiles the unsupported predicate before dispatch, so that refusal carries no request ID; the two argument refusals are dispatched. - AcSeries012: after the silo restart the test waited for routing on the restarted node only, and a read through another node still returned OwnershipLost; it now waits until every node reports all silos. Verification: integration tests build with -warnaserror; dotnet format verify; governance PASS; locally SqlModelViewClusterParityTests, LeftFilteredJoinCluster Tests and AcSeries012SiloRestartRetainsLatestAndWindowValuesOnEveryReplica pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent befe1d6 commit 3db6e5f

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎tests/KeyLoad.IntegrationTests/Authorization/Assertions/ResourcePolicies/ModelRootCluster.cs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ await ModelRootClusterWave.ObserveAsync(root, state, async () => await MessageAs
2727
{
2828
var stream = new StreamRef(state.Partition, state.Resource, ModelRootClusterState.Item);
2929
var request = new ReadStreamRequest(stream);
30-
var recordedAt = JsonNode.Parse(state.Original.Json)![ModelRootClusterState.RecordedAtField]!.GetValue<DateTimeOffset>();
31-
var expected = new EventRecord(stream, 1L, 1L,
30+
var original = JsonNode.Parse(state.Original.Json)!;
31+
var recordedAt = original[ModelRootClusterState.RecordedAtField]!.GetValue<DateTimeOffset>();
32+
// The event sequence counts every event in the partition, so it is the one the original row reported.
33+
var sequence = original[ModelRootClusterState.EventSequenceField]!.GetValue<long>();
34+
var expected = new EventRecord(stream, 1L, sequence,
3235
new(ModelRootClusterState.Item, ModelRootClusterState.Type, Body(state, read, false), Body(state, read, true)), recordedAt);
3336
await ModelRootClusterWave.ObserveAsync(root, state, async () => await StreamAsync(
3437
await McpCallerAssertions.SdkSuccessAsync(await reader.Sdk.ReadStreamAsync(request, token)), expected), token);

‎tests/KeyLoad.IntegrationTests/RelationalStorage/Scenarios/Joins/LeftFilteredJoinRefusals.cs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@ internal static async Task InvalidAsync(RequestCqrsClusterCallers callers, LeftF
2222
CancellationToken token)
2323
{
2424
var request = LeftFilteredJoinProtocol.Request(state.Partition);
25-
foreach (var (input, code) in new[]
25+
// The unified SQL tool compiles the text before dispatch, so the unsupported predicate is refused there without a
26+
// request ID; the argument refusals need the stored model and are dispatched.
27+
foreach (var (input, code, dispatched) in new[]
2628
{
27-
(request with { Parameters = null }, ErrorCode.Validation),
29+
(request with { Parameters = null }, ErrorCode.Validation, true),
2830
(request with { Sql = LeftFilteredJoinProtocol.Prefix + "WHERE r.name = @minimum "
29-
+ LeftFilteredJoinProtocol.Order }, ErrorCode.UnsupportedCapability),
31+
+ LeftFilteredJoinProtocol.Order }, ErrorCode.UnsupportedCapability, false),
3032
(request with { Parameters = new() { [MinimumFieldKey] = System.Text.Json.JsonSerializer.SerializeToElement("wrong") } },
31-
ErrorCode.Validation)
33+
ErrorCode.Validation, true)
3234
})
3335
{
3436
var failure = await callers.Sdk.ExecuteSqlAsync(input, token);
3537
await Assert.That(failure.IsSuccess).IsFalse();
3638
await Assert.That(failure.Problem?.ErrorCode).IsEqualTo(code.ToString());
3739
await McpCallerAssertions.ErrorAsync(await callers.Mcp.CallAsync(SqlOperationProtocol.ToolName,
38-
input, token), code, dispatched: true);
40+
input, token), code, dispatched);
3941
}
4042
}
4143

‎tests/KeyLoad.IntegrationTests/TimeSeries/Cases/TimeSeriesClusterReplicaRestartTests.cs‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,8 @@ await Assert.That(initial.Sample?.Sample.Value)
6868

6969
await fixture.RestartServerAsync(stoppedNode, deadline.Token);
7070
restarted = true;
71-
await ClusterReplicationTestSupport.EventuallyAsync(async () =>
72-
{
73-
var status = await clients[selectedIndex].StatusAsync(deadline.Token);
74-
return status.IsSuccess && status.Value.RoutingReady;
75-
}, deadline.Token);
71+
// A write needs every copy, and a read can route through any node, so every node must report all silos.
72+
await ClusterMembershipReadiness.WaitForActiveSilosAsync(clients, deadline.Token);
7673
await Assert.That(Directory.Exists(Path.Combine(fixture.Root, stoppedNode))).IsTrue();
7774
var committed = ClusterReplicationTestSupport.Success(await clients[survivorIndex].CommitAsync(command, deadline.Token));
7875
await Assert.That(committed.Durability).IsEqualTo(DurabilityProfile.ProcessDurable);

0 commit comments

Comments
 (0)