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-4450: [3.2.2 backport ] TestReplicationConfigUpdatedAt fix #7281

Merged
merged 1 commit into from
Jan 10, 2025
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
7 changes: 4 additions & 3 deletions rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8570,6 +8570,8 @@ func TestReplicationConfigUpdatedAt(t *testing.T) {
// create a replication and assert the updated at field is present in the config
activeRT.CreateReplication("replication1", remoteURLString, db.ActiveReplicatorTypePush, nil, true, db.ConflictResolverDefault)

activeRT.WaitForReplicationStatus("replication1", db.ReplicationStateRunning)

resp := activeRT.SendAdminRequest(http.MethodGet, "/{{.db}}/_replication/replication1", "")
var configResponse db.ReplicationConfig
require.NoError(t, json.Unmarshal(resp.BodyBytes(), &configResponse))
Expand All @@ -8580,12 +8582,11 @@ func TestReplicationConfigUpdatedAt(t *testing.T) {
currTime := configResponse.UpdatedAt
createdAtTime := configResponse.CreatedAt

// avoid flake where update at seems to be the same (possibly running to fast)
time.Sleep(500 * time.Nanosecond)

resp = activeRT.SendAdminRequest("PUT", "/{{.db}}/_replicationStatus/replication1?action=stop", "")
rest.RequireStatus(t, resp, http.StatusOK)

activeRT.WaitForReplicationStatus("replication1", db.ReplicationStateStopped)

// update the config
resp = activeRT.SendAdminRequest(http.MethodPut, "/{{.db}}/_replication/replication1", fmt.Sprintf(`{"name":"replication1","source":"%s","type":"push", "continuous":true}`, remoteURLString))
rest.RequireStatus(t, resp, http.StatusOK)
Expand Down
Loading