fix: apply BecomeLeader() to all cluster test fixtures after stepdown

Extended the BecomeLeader() fix to JetStreamClusterFixture,
ClusterFailoverFixture, and LeaderFailoverParityFixture. All three
fixtures now auto-simulate leader election after stepdown, matching
the MetaControllerFixture fix from the previous commit.
This commit is contained in:
Joseph Doherty
2026-02-24 18:09:28 -05:00
parent d286349262
commit b0fa01e201
3 changed files with 34 additions and 4 deletions

View File

@@ -519,7 +519,14 @@ internal sealed class ClusterFailoverFixture : IAsyncDisposable
=> _consumerManager.FetchAsync(stream, durableName, batch, _streamManager, default).AsTask();
public Task<JetStreamApiResponse> RequestAsync(string subject, string payload)
=> Task.FromResult(_router.Route(subject, Encoding.UTF8.GetBytes(payload)));
{
var response = _router.Route(subject, Encoding.UTF8.GetBytes(payload));
if (subject.Equals(JetStreamApiSubjects.MetaLeaderStepdown, StringComparison.Ordinal) && response.Success)
_metaGroup.BecomeLeader();
return Task.FromResult(response);
}
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
}