diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4cd690af..f8e58ce7 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -33,7 +33,7 @@ jobs: cache: maven - name: Build with coveralls report if: ${{ env.cov_token != '' }} - run: mvn -B -DjacocoReports=jetcache-test/target/site/jacoco-aggregate/jacoco.xml clean test jacoco:report-aggregate coveralls:report -DrepoToken=${{ secrets.COV_TOKEN }} + run: mvn -B -DjacocoReports=jetcache-test/target/site/jacoco-aggregate/jacoco.xml clean test jacoco:report-aggregate coveralls:report -DrepoToken=${{ secrets.COV_TOKEN }} -Dtick=3 - name: Build without coveralls report if: ${{ env.cov_token == '' }} run: mvn -B clean test \ No newline at end of file diff --git a/jetcache-test/src/main/java/com/alicp/jetcache/test/AbstractCacheTest.java b/jetcache-test/src/main/java/com/alicp/jetcache/test/AbstractCacheTest.java index 44ebe95f..0b8ce6c6 100644 --- a/jetcache-test/src/main/java/com/alicp/jetcache/test/AbstractCacheTest.java +++ b/jetcache-test/src/main/java/com/alicp/jetcache/test/AbstractCacheTest.java @@ -36,6 +36,8 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; +import static com.alicp.jetcache.test.support.Tick.tick; + /** * Created on 2016/10/8. * @@ -928,7 +930,7 @@ private static class PenetrationTestThread extends Thread { this.cache = cache; this.loader = k -> { try { - Thread.sleep(75); + Thread.sleep(tick(50)); } catch (InterruptedException e) { throw new RuntimeException(e); } diff --git a/jetcache-test/src/main/java/com/alicp/jetcache/test/support/Tick.java b/jetcache-test/src/main/java/com/alicp/jetcache/test/support/Tick.java new file mode 100644 index 00000000..f9bb7554 --- /dev/null +++ b/jetcache-test/src/main/java/com/alicp/jetcache/test/support/Tick.java @@ -0,0 +1,31 @@ +/* + * Copyright The Dongting Project + * + * The Dongting Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package com.alicp.jetcache.test.support; + +/** + * @author huangli + */ +public class Tick { + private static final int TICK = Integer.parseInt(System.getProperty("tick", "1")); + + public static int tick(int value) { + return value * TICK; + } + + public static long tick(long value) { + return value * TICK; + } +}