Let cache sweeper run

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2018-08-27 12:56:28 -06:00
parent ad3a1506d3
commit 2c4b7e7d54

View File

@@ -313,6 +313,9 @@ func TestSublistCache(t *testing.T) {
s.Match(fmt.Sprintf("foo-%d\n", i))
}
// Let cleanup Go routine run.
runtime.Gosched()
if cc := s.CacheCount(); cc > slCacheMax {
t.Fatalf("Cache should be constrained by cacheMax, got %d for current count\n", cc)
}