From dd72c4aec3a8549196a2d34d1b7ac6ba6d448e04 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Thu, 10 Aug 2023 14:41:07 +0000 Subject: [PATCH] roachtest: pin liveness lease to live node in lease prefs test The lease preferences roachtest could occasionally fail, if the liveness leaseholder were on a stopped node. We should address this issue, for now, pin the liveness lease to a live node to prevent flakes. Informs: #108512 Resolves: #108425 Release note: None --- pkg/cmd/roachtest/tests/lease_preferences.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cmd/roachtest/tests/lease_preferences.go b/pkg/cmd/roachtest/tests/lease_preferences.go index 000085e87e65..53d969b24b21 100644 --- a/pkg/cmd/roachtest/tests/lease_preferences.go +++ b/pkg/cmd/roachtest/tests/lease_preferences.go @@ -253,6 +253,14 @@ func runLeasePreferences( // enforcement. require.NoError(t, WaitForReplication(ctx, t, conn, spec.replFactor)) + // Set a lease preference for the liveness range, to be on n5. This test + // would occasionally fail due to the liveness heartbeat failures, when the + // liveness lease is on a stopped node. This is not ideal behavior, #108512. + configureZone(t, ctx, conn, "RANGE liveness", zoneConfig{ + replicas: spec.replFactor, + leaseNode: 5, + }) + t.L().Printf("setting lease preferences: %s", spec.preferences) setLeasePreferences(ctx, spec.preferences) t.L().Printf("waiting for initial lease preference conformance")