Skip to content

Commit

Permalink
[release-16.0] Fix TestGatewayBufferingWhileReparenting flakiness (#…
Browse files Browse the repository at this point in the history
…13469) (#13500)

Fix `TestGatewayBufferingWhileReparenting` flakiness (#13469)
  • Loading branch information
GuptaManan100 authored Jul 17, 2023
1 parent 4ae3d69 commit 19db42e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/vt/vtgate/tabletgateway_flaky_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ func TestGatewayBufferingWhileReparenting(t *testing.T) {
hc.Broadcast(primaryTablet)
// set the serving type for the primary tablet false and broadcast it so that the buffering code registers this change
hc.SetServing(primaryTablet, false)
// We call the broadcast twice to ensure that the change has been processed by the keyspace event watcher.
// The second broadcast call is blocking until the first one has been processed.
hc.Broadcast(primaryTablet)
hc.Broadcast(primaryTablet)

require.Len(t, tg.hc.GetHealthyTabletStats(target), 0, "GetHealthyTabletStats has tablets even though it shouldn't")
isNotServing := tg.kev.PrimaryIsNotServing(target)
require.True(t, isNotServing)

// add a result to the sandbox connection of the new primary
sbcReplica.SetResults([]*sqltypes.Result{sqlResult1})
Expand Down

0 comments on commit 19db42e

Please sign in to comment.