Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 3d343ab

Browse files
committed
fix tests
1 parent 3e80a1f commit 3d343ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

idx/memory/find_cache_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestTreeFromPath(t *testing.T) {
8484

8585
func TestFindCache(t *testing.T) {
8686
Convey("when findCache is empty", t, func() {
87-
c := NewFindCache(10, 1, time.Second*2)
87+
c := NewFindCache(10, 5, 2, time.Second, time.Second*2)
8888
Convey("0 results should be returned", func() {
8989
result, ok := c.Get(1, "foo.bar.*")
9090
So(ok, ShouldBeFalse)
@@ -116,7 +116,7 @@ func TestFindCache(t *testing.T) {
116116
c.Add(1, "foo.{a,b,c}*.*", results)
117117
c.Add(1, "foo.{a,b,e}*.*", results)
118118
c.Add(1, "foo.{a,b,f}*.*", results)
119-
c.newSeries[1] <- struct{}{}
119+
c.backoff = time.Now().Add(time.Second)
120120
c.InvalidateFor(1, "foo.baz.foo.a.b.c.d.e.f.g.h")
121121

122122
So(len(c.cache), ShouldEqual, 0)

idx/memory/memory_find_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ func benchmarkConcurrentInsertFind(b *testing.B) {
873873
defer func() {
874874
TagSupport = _tagSupport
875875
}()
876-
findCacheInvalidateQueue = 10
876+
findCacheInvalidateQueueSize = 10
877877
InitLargeIndex()
878878
queryCount := len(queries)
879879
var wg sync.WaitGroup

0 commit comments

Comments
 (0)