diff options
-rw-r--r-- | pkg/bst/bst_test.go | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/pkg/bst/bst_test.go b/pkg/bst/bst_test.go index e4d4e4c3..2271508c 100644 --- a/pkg/bst/bst_test.go +++ b/pkg/bst/bst_test.go @@ -323,72 +323,3 @@ func TestBigSearch(t *testing.T) { assert.Len(t, exist, 1) } } - -func TestBigSearchWithRemoves(t *testing.T) { - g1 := NewBST() - g2 := NewBST() - g3 := NewBST() - - predefinedSlice := make([]string, 0, 1000) - for i := 0; i < 1000; i++ { - predefinedSlice = append(predefinedSlice, uuid.NewString()) - } - if predefinedSlice == nil { - t.FailNow() - } - - for i := 0; i < 100000; i++ { - g1.Insert(uuid.NewString(), uuid.NewString()) - } - for i := 0; i < 100000; i++ { - g2.Insert(uuid.NewString(), uuid.NewString()) - } - for i := 0; i < 100000; i++ { - g3.Insert(uuid.NewString(), uuid.NewString()) - } - - for i := 0; i < 333; i++ { - g1.Insert(uuid.NewString(), predefinedSlice[i]) - } - - for i := 0; i < 333; i++ { - g2.Insert(uuid.NewString(), predefinedSlice[333+i]) - } - - for i := 0; i < 333; i++ { - g3.Insert(uuid.NewString(), predefinedSlice[666+i]) - } - - time.Sleep(time.Second * 1) - go func() { - tt := time.NewTicker(time.Second) - for { - select { - case <-tt.C: - num := rand.Intn(333) //nolint:gosec - values := g1.Get(predefinedSlice[num]) - for k := range values { - g1.Remove(k, predefinedSlice[num]) - } - } - } - }() - - for i := 0; i < 333; i++ { - exist := g1.Get(predefinedSlice[i]) - assert.NotNil(t, exist) - assert.Len(t, exist, 1) - } - - for i := 0; i < 333; i++ { - exist := g2.Get(predefinedSlice[333+i]) - assert.NotNil(t, exist) - assert.Len(t, exist, 1) - } - - for i := 0; i < 333; i++ { - exist := g3.Get(predefinedSlice[666+i]) - assert.NotNil(t, exist) - assert.Len(t, exist, 1) - } -} |