Skip to content

Commit

Permalink
fix: read repair acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
moogacs committed Apr 17, 2024
1 parent 4247319 commit 72f75b2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/acceptance/replication/read_repair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func readRepair(t *testing.T) {
defer cancel()

compose, err := docker.New().
With2NodeCluster().
With3NodeCluster().
WithText2VecContextionary().
Start(ctx)
require.Nil(t, err)
Expand All @@ -47,12 +47,12 @@ func readRepair(t *testing.T) {

t.Run("create schema", func(t *testing.T) {
paragraphClass.ReplicationConfig = &models.ReplicationConfig{
Factor: 2,
Factor: 3,
}
paragraphClass.Vectorizer = "text2vec-contextionary"
helper.CreateClass(t, paragraphClass)
articleClass.ReplicationConfig = &models.ReplicationConfig{
Factor: 2,
Factor: 3,
}
helper.CreateClass(t, articleClass)
})
Expand Down Expand Up @@ -106,6 +106,7 @@ func readRepair(t *testing.T) {
})

t.Run("stop node 1", func(t *testing.T) {
time.Sleep(3 * time.Second) // wait before killing a leader so that data replicated to followers
stopNodeAt(ctx, t, compose, 1)
time.Sleep(10 * time.Second)
})
Expand Down Expand Up @@ -140,15 +141,17 @@ func readRepair(t *testing.T) {
require.True(t, exists)
})

t.Run("assert updated object read repair was made", func(t *testing.T) {
t.Run("stop node 2", func(t *testing.T) {
stopNodeAt(ctx, t, compose, 2)
})

exists, err := objectExistsCL(t, compose.GetWeaviate().URI(),
t.Run("assert updated object read repair was made", func(t *testing.T) {
exists, err := objectExistsCL(t, compose.ContainerURI(1),
replaceObj.Class, replaceObj.ID, replica.One)
require.Nil(t, err)
require.True(t, exists)

resp, err := getObjectCL(t, compose.GetWeaviate().URI(),
resp, err := getObjectCL(t, compose.ContainerURI(1),
repairObj.Class, repairObj.ID, replica.One)
require.Nil(t, err)
assert.Equal(t, replaceObj.ID, resp.ID)
Expand Down

0 comments on commit 72f75b2

Please sign in to comment.