From 7258704944487d4beefa339cb2240fa9bb7fda7c Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Thu, 19 Dec 2024 17:29:22 +0530 Subject: [PATCH] test: add test for verifying we can't start a new request Signed-off-by: Manan Gupta --- go/vt/vttablet/tabletserver/state_manager_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/vt/vttablet/tabletserver/state_manager_test.go b/go/vt/vttablet/tabletserver/state_manager_test.go index 58f293d52b3..f8059d6edea 100644 --- a/go/vt/vttablet/tabletserver/state_manager_test.go +++ b/go/vt/vttablet/tabletserver/state_manager_test.go @@ -700,6 +700,9 @@ func TestDemotePrimaryStalled(t *testing.T) { sm.Broadcast() gotshr = <-ch require.EqualValues(t, "VT09031: Primary demotion is stalled", gotshr.RealtimeStats.HealthError) + // Verify that we can't start a new request once we have a demote primary stalled. + err = sm.StartRequest(context.Background(), &querypb.Target{TabletType: topodatapb.TabletType_PRIMARY}, false) + require.ErrorContains(t, err, "operation not allowed in state NOT_SERVING") // Stop the state manager. sm.StopService()