diff --git a/server/jetstream_cluster_4_test.go b/server/jetstream_cluster_4_test.go index 94d9952d81..b3ef31b1b6 100644 --- a/server/jetstream_cluster_4_test.go +++ b/server/jetstream_cluster_4_test.go @@ -3967,7 +3967,9 @@ func TestJetStreamClusterDesyncAfterErrorDuringCatchup(t *testing.T) { for _, n := range server.raftNodes { rn := n.(*raft) if rn.accName == "$G" { + rn.Lock() rn.updateLeader(noLeader) + rn.Unlock() } }