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

CBG-3091: [3.1.1] backport the small fix for flake on TestReconnectReplicator in jenkins #6299

Merged
merged 1 commit into from
Jun 12, 2023
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
8 changes: 6 additions & 2 deletions rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2308,14 +2308,18 @@ func TestReconnectReplicator(t *testing.T) {

activeRT.WaitForActiveReplicatorInitialization(1)
ar := activeRT.GetDatabase().SGReplicateMgr.GetActiveReplicator("replication1")
numConnectionAttempts := ar.Pull.GetStats().NumConnectAttempts.Value()
// race between stopping the blip sender here and the initialization of it on the replicator so need this assertion in here to avoid panic
activeRT.WaitForPullBlipSenderInitialisation(replicationName)
ar.Pull.GetBlipSender().Stop()

activeRT.WaitForReplicationStatus(replicationName, db.ReplicationStateReconnecting)

// assert on replicator reconnecting and getting back to running state once reconnected
// due to race in jenkins we assert on connection stat increasing instead of asserting on replication state hitting reconnecting state
ar = activeRT.GetDatabase().SGReplicateMgr.GetActiveReplicator("replication1")
assert.Greater(t, ar.Pull.GetStats().NumConnectAttempts.Value(), numConnectionAttempts)
activeRT.WaitForReplicationStatus(replicationName, db.ReplicationStateRunning)

// assert the replicator works and we replicate docs still after replicator reconnects
for i := 0; i < 10; i++ {
response := remoteRT.SendAdminRequest(http.MethodPut, "/{{.keyspace}}/"+fmt.Sprint(i), `{"source": "remote"}`)
rest.RequireStatus(t, response, http.StatusCreated)
Expand Down