summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-05 22:36:20 +0300
committerValery Piashchynski <[email protected]>2021-06-05 22:36:20 +0300
commite1b6b6a771e09128ea8aa65c895c715b08996165 (patch)
tree43130b439acdf7499a8d086c9a61c215f14d7d91 /pkg
parent908b2893728b812997f2b03244ab9b37d668fe3f (diff)
- Remove incorrect test with races
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/bst/bst_test.go69
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)
- }
-}