mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix ConcurrencyTester thread size too large, 可能会 java.lang.OutOfMemoryError
This commit is contained in:
parent
d6ac2ef4bc
commit
e327458eb6
@ -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…
x
Reference in New Issue
Block a user