Skip to content

Commit

Permalink
chore(tests): enhance the namespace replication to prevent flaky test (
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk authored Sep 17, 2024
1 parent 89c5b24 commit 2a0c57a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/gocase/unit/namespace/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,10 @@ func TestNamespaceReplicateWithFullSync(t *testing.T) {
util.WaitForOffsetSync(t, masterClient, slaveClient, 60*time.Second)

// Namespaces should be replicated after the full sync
token, err := slaveClient.Do(ctx, "NAMESPACE", "GET", "foo").Result()
require.NoError(t, err)
require.EqualValues(t, "bar", token)
require.Eventually(t, func() bool {
token, _ := slaveClient.Do(ctx, "NAMESPACE", "GET", "foo").Val().(string)
return token == "bar"
}, 5*time.Second, 100*time.Millisecond)
}

func TestNamespaceRewrite(t *testing.T) {
Expand Down

0 comments on commit 2a0c57a

Please sign in to comment.