Skip to content

Commit

Permalink
CBG-4450: [3.2.2 backport ] TestReplicationConfigUpdatedAt fix (#7281)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregns1 authored Jan 10, 2025
1 parent b506faa commit 11624d1
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 11624d1

Please sign in to comment.