Skip to content

Commit

Permalink
test: add test for verifying we can't start a new request
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Dec 19, 2024
1 parent 0b8c3f4 commit 7258704
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/vt/vttablet/tabletserver/state_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7258704

Please sign in to comment.