Skip to content

Commit

Permalink
cache: Add even more concurrency to test
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jun 28, 2017
1 parent b3c8056 commit 3aa0e16
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cache/partitioned_lazy_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3aa0e16

Please sign in to comment.