Skip to content

Commit

Permalink
test: add some comments
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 authored and shlomi-noach committed Mar 21, 2024
1 parent 92c3641 commit 2bbef59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/test/endtoend/vtorc/general/vtorc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ func TestDurabilityPolicySetLater(t *testing.T) {
utils.CheckReplication(t, newCluster, primary, shard0.Vttablets, 10*time.Second)
}

// TestFullStatusConnectionPooling tests that full status RPC succeeds despite a vttablet restarting with a different
// IP address and then back to its original. This test has been added in response to a bug seen in production with a similar situation occurring.
func TestFullStatusConnectionPooling(t *testing.T) {
defer utils.PrintVTOrcLogsOnFailure(t, clusterInfo.ClusterInstance)
defer cluster.PanicHandler(t)
Expand Down Expand Up @@ -525,6 +527,8 @@ func TestFullStatusConnectionPooling(t *testing.T) {
assert.Equal(t, 200, status)
assert.Contains(t, resp, "UnreachablePrimary")

// We have to wait for some time to ensure the gRPC connections from VTOrc to vttablet
// are broken and closed due to keep-alives. Without this timeout the gRPC connections stay open and test passes trivially.
time.Sleep(1 * time.Minute)

// Change the primaries ports and restart it.
Expand Down Expand Up @@ -552,8 +556,6 @@ func TestFullStatusConnectionPooling(t *testing.T) {
assert.Equal(t, 200, status)
assert.Contains(t, resp, "UnreachablePrimary")

time.Sleep(1 * time.Minute)

// Change the primaries ports back to original and restart it.
curPrimary.VttabletProcess.Port = curPrimary.HTTPPort
curPrimary.VttabletProcess.GrpcPort = curPrimary.GrpcPort
Expand Down

0 comments on commit 2bbef59

Please sign in to comment.