fix: locking
This commit is contained in:
1 parent
c8a16d3f3e
commit
6041cc0a33
2 files changed
+27
-5
No files matched your search
@@ -104,6 +104,16 @@ func TestLazyByIDShardFetchesMatchingPrefix(t *testing.T) {
|
||||
if _, err := shard.(*lazyByIDShardNode).Lookup(context.Background(), "it-item-1.pdf"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
lookupAgain, err := byID.(*lazyByIDNode).Lookup(context.Background(), "it")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if lookupAgain != shard {
|
||||
t.Fatal("expected repeated shard lookup to return its cached node")
|
||||
}
|
||||
if _, err := lookupAgain.(*lazyByIDShardNode).Lookup(context.Background(), "it-item-1.pdf"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(queries) != 2 || queries[0] != "id:it*" || queries[1] != "id:it*" {
|
||||
t.Fatalf("unexpected queries: %v", queries)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user