mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
!666 修复:ConcurrencyTester默认线程池太大,导致:测试用例:oom (java.lang.OutOfMemoryError)的问题
Merge pull request !666 from dazer007/v6-dev-concurrencyTester-threadSize-too-big
This commit is contained in:
commit
40748eaa0d
@ -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";
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user