!666 修复:ConcurrencyTester默认线程池太大,导致:测试用例:oom (java.lang.OutOfMemoryError)的问题

Merge pull request !666 from dazer007/v6-dev-concurrencyTester-threadSize-too-big
This commit is contained in:
Looly 2022-06-29 10:59:58 +00:00 committed by Gitee
commit 40748eaa0d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ public class SimpleCacheTest {
@Test
public void getConcurrencyTest(){
final SimpleCache<String, String> cache = new SimpleCache<>();
final ConcurrencyTester tester = new ConcurrencyTester(9000);
final ConcurrencyTester tester = new ConcurrencyTester(2000);
tester.test(()-> cache.get("aaa", ()-> {
ThreadUtil.sleep(200);
return "aaaValue";

View File

@ -46,7 +46,7 @@ public class WeakConcurrentMapTest {
@Test
public void getConcurrencyTest(){
final WeakConcurrentMap<String, String> cache = new WeakConcurrentMap<>();
final ConcurrencyTester tester = new ConcurrencyTester(9000);
final ConcurrencyTester tester = new ConcurrencyTester(2000);
tester.test(()-> cache.computeIfAbsent("aaa" + RandomUtil.randomInt(2), (key)-> "aaaValue"));
Assert.assertTrue(tester.getInterval() > 0);