Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-17.0] Fix TestGatewayBufferingWhileReparenting flakiness (#13469) #13499

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 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 All @@ -197,8 +204,6 @@ func TestGatewayBufferingWhileReparenting(t *testing.T) {
queryChan <- struct{}{}
}()

require.Len(t, tg.hc.GetHealthyTabletStats(target), 0, "GetHealthyTabletStats has tablets even though it shouldn't")

// set the serving type for the new primary tablet true and broadcast it so that the buffering code registers this change
// this should stop the buffering and the query executed in the go routine should work. This should be done with some delay so
// that we know that the query was buffered
Expand Down
Loading