cache: Add even more concurrency to test
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 28 Jun 2017 20:47:28 +0000 (22:47 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 28 Jun 2017 20:47:28 +0000 (22:47 +0200)
cache/partitioned_lazy_cache_test.go

index 97c8e09da755423706340e505d1e5291306e2002..ba8b6a454bbb259634ebe4b8eddf076d5beb6f41 100644 (file)
@@ -123,13 +123,15 @@ func TestConcurrentPartitionedLazyCache(t *testing.T) {
 
        cache := NewPartitionedLazyCache(p1, p2)
 
-       for j := 0; j < 100; j++ {
+       for i := 0; i < 100; i++ {
                wg.Add(1)
                go func() {
                        defer wg.Done()
-                       v, err := cache.Get("p1", "p1_1")
-                       assert.NoError(err)
-                       assert.Equal("p1v1", v)
+                       for j := 0; j < 10; j++ {
+                               v, err := cache.Get("p1", "p1_1")
+                               assert.NoError(err)
+                               assert.Equal("p1v1", v)
+                       }
                }()
        }
        wg.Wait()