Skip to content

Commit

Permalink
Run the test suite with GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolovison authored and willr3 committed Jan 9, 2025
1 parent 0fc96a9 commit 327e28c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
run: mvn --version
- name: Build
run: |
mvn clean install -DskipTests
mvn clean install -DskipTests --no-transfer-progress
- name: Tar Maven Repo
shell: bash
run: tar -I 'pigz -9' -cf maven-repo.tgz -C ~ .m2/repository
- name: Persist Maven Repo
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: maven-repo
path: maven-repo.tgz
Expand All @@ -75,7 +75,7 @@ jobs:
- name: Maven Version
run: mvn --version
- name: Download Maven Repo
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: maven-repo
path: .
Expand All @@ -84,11 +84,18 @@ jobs:
run: tar -xzf maven-repo.tgz -C ~
- name: Build
run: |
./mvnw clean test
- name: Upload artifact for failed workflow
if: failure()
uses: actions/upload-artifact@v2
./mvnw clean test --no-transfer-progress
- name: Print JVM Thread Dumps When Cancelled
if: cancelled()
run: |
for jvm_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do
jcmd $jvm_pid Thread.print
done
- name: Upload logs for failed/cancelled workflow
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: test logs
name: logs
path: |
*/target/surefire-reports/*
*/target/surefire-reports/*
/tmp/qdup*
17 changes: 14 additions & 3 deletions src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ public Dispatcher(){
AtomicInteger count = new AtomicInteger(0);
@Override
public Thread newThread(Runnable runnable) {
Thread rtrn = new Thread(runnable,"execute-"+count.getAndAdd(1));
Thread rtrn = new Thread(runnable,"qDup-execute-"+count.getAndAdd(1));
rtrn.setUncaughtExceptionHandler(DefaultUncaughtExceptionHandler);
return rtrn;
}
}),
new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors()/2,new ThreadFactory() {
new ScheduledThreadPoolExecutor(getMinimumScheduleCorePoolSize(),new ThreadFactory() {
AtomicInteger count = new AtomicInteger(0);
@Override
public Thread newThread(Runnable runnable) {
return new Thread(runnable,"schedule-"+count.getAndAdd(1));
return new Thread(runnable,"qDup-schedule-"+count.getAndAdd(1));
}
}),
true
Expand Down Expand Up @@ -474,4 +474,15 @@ private void checkActiveCount(){
stop();
}
}
/*
* See: https://github.com/Hyperfoil/qDup/issues/229
*/
private static int getMinimumScheduleCorePoolSize() {
int cores = Runtime.getRuntime().availableProcessors() / 2;
if (cores < 3) {
return 3;
} else {
return cores;
}
}
}

0 comments on commit 327e28c

Please sign in to comment.