mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
allow for translate store race in test (by using retry)
In this case, the test is reading from the translateStore replica before the translateStore replication has had time to deliver its log to the replica. The only way to truly address this in the translate store would be to route all key misses that happen on a read-only replica to the primary translate store (or somehow know when the primary is done sending to replicas) for actual verification that the key does not exist. That's more involved than we want to do here; this PR just addresses the problem in the test.
This commit is contained in:
parent
9cec40e69d
commit
0a69fca657
1 changed files with 8 additions and 3 deletions
11
api_test.go
11
api_test.go
|
|
@ -175,10 +175,15 @@ func TestAPI_Import(t *testing.T) {
|
|||
}
|
||||
|
||||
// Query node1.
|
||||
if res, err := m1.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil {
|
||||
if err := test.RetryUntil(5*time.Second, func() error {
|
||||
if res, err := m1.API.Query(ctx, &pilosa.QueryRequest{Index: index, Query: pql}); err != nil {
|
||||
return err
|
||||
} else if columns := res.Results[0].(*pilosa.Row).Columns(); !reflect.DeepEqual(columns, colIDs) {
|
||||
return fmt.Errorf("unexpected column ids: %+v", columns)
|
||||
}
|
||||
return nil
|
||||
}); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if columns := res.Results[0].(*pilosa.Row).Columns(); !reflect.DeepEqual(columns, colIDs) {
|
||||
t.Fatalf("unexpected column ids: %+v", columns)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue