diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 91b95d4f37c..04043338f54 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -73,6 +73,9 @@ jobs: runs-on: "ubuntu-20.04" container: image: docker.io/dragonwelljdk/build_jdk:8u + defaults: + run: + shell: bash strategy: fail-fast: false matrix: @@ -100,12 +103,14 @@ jobs: ls /opt/dragonwell8 chmod -R 777 /opt/dragonwell8 /opt/dragonwell8/bin/java -version + echo "Current shell $SHELL" + csh + echo "Current shell $SHELL" + ps - name: Test run: | - jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/__w/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/__w/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" + SHELL=/bin/bash jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/__w/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/__w/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" - name: Check that all tests executed successfully run: > - if [[ egrep -q "(failed|error)" /__w/dragonwell8/dragonwell8/JTreport/text/stats.txt ]]; then - cat /__w/dragonwell8/dragonwell8/JTreport/newfailures.txt /__w/dragonwell8/dragonwell8/JTreport/other_errors.txt; - exit 1 ; - fi \ No newline at end of file + cat /__w/dragonwell8/dragonwell8/JTreport/newfailures.txt /__w/dragonwell8/dragonwell8/JTreport/other_errors.txt + egrep -q "(failed|error)" /__w/dragonwell8/dragonwell8/JTreport/text/stats.txt && exit 1 ; diff --git a/hotspot/test/ProblemList.txt b/hotspot/test/ProblemList.txt index 163a0336e60..2ea4f9c7bf7 100644 --- a/hotspot/test/ProblemList.txt +++ b/hotspot/test/ProblemList.txt @@ -86,12 +86,4 @@ runtime/coroutine/PreemptWispInternalBugTest.java generic-all runtime/coroutine/PremainWithWispMonitorTest.java generic-all runtime/coroutine/PremainWithWispMonitorTest.java generic-all runtime/coroutine/WispStealMonitorC2Test.java generic-all -serviceability/sa/jmap-hashcode/Test8028623.java generic-all -jwarmup/issue9780156.sh generic-all -jwarmup/TestCheckIfCompilationIsComplete.sh generic-all -jwarmup/TestDisableMethodData.sh generic-all -jwarmup/TestNotDeoptJITMethod.sh generic-all -jwarmup/TestNotifyDeopt.sh generic-all -jwarmup/TestTieredCompilationInRecording.sh generic-all -multi-tenant/TestParGCAllocatorLeak.sh generic-all -multi-tenant/TestTenantJVMOptions.sh generic-all +serviceability/sa/jmap-hashcode/Test8028623.java generic-all \ No newline at end of file diff --git a/hotspot/test/jwarmup/TestCheckIfCompilationIsComplete.sh b/hotspot/test/jwarmup/TestCheckIfCompilationIsComplete.sh index d4c56d2b20b..b53ca1cfa78 100644 --- a/hotspot/test/jwarmup/TestCheckIfCompilationIsComplete.sh +++ b/hotspot/test/jwarmup/TestCheckIfCompilationIsComplete.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/hotspot/test/jwarmup/TestDisableMethodData.sh b/hotspot/test/jwarmup/TestDisableMethodData.sh index 88955691361..b063e4af50e 100644 --- a/hotspot/test/jwarmup/TestDisableMethodData.sh +++ b/hotspot/test/jwarmup/TestDisableMethodData.sh @@ -1,5 +1,4 @@ -#!/bin/sh -# +#!/bin/bash # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # diff --git a/hotspot/test/jwarmup/TestNotDeoptJITMethod.sh b/hotspot/test/jwarmup/TestNotDeoptJITMethod.sh index 8a8af2f8632..071f469525d 100644 --- a/hotspot/test/jwarmup/TestNotDeoptJITMethod.sh +++ b/hotspot/test/jwarmup/TestNotDeoptJITMethod.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/hotspot/test/jwarmup/TestNotifyDeopt.sh b/hotspot/test/jwarmup/TestNotifyDeopt.sh index 3cf5adce324..dc07adec60e 100644 --- a/hotspot/test/jwarmup/TestNotifyDeopt.sh +++ b/hotspot/test/jwarmup/TestNotifyDeopt.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/hotspot/test/jwarmup/TestTieredCompilationInRecording.sh b/hotspot/test/jwarmup/TestTieredCompilationInRecording.sh index 5ebe813861c..41aa63ac047 100644 --- a/hotspot/test/jwarmup/TestTieredCompilationInRecording.sh +++ b/hotspot/test/jwarmup/TestTieredCompilationInRecording.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/hotspot/test/jwarmup/issue9780156.sh b/hotspot/test/jwarmup/issue9780156.sh index 1ab02c7e820..ae696fcd8ac 100644 --- a/hotspot/test/jwarmup/issue9780156.sh +++ b/hotspot/test/jwarmup/issue9780156.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh b/hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh index c766a8c6c2a..061f604d7b3 100644 --- a/hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh +++ b/hotspot/test/multi-tenant/TestParGCAllocatorLeak.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash -# +#!/bin/bash # Copyright (c) 2020 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # diff --git a/hotspot/test/multi-tenant/TestTenantJVMOptions.sh b/hotspot/test/multi-tenant/TestTenantJVMOptions.sh index 83d5a6d2859..43f2bdf1e8e 100644 --- a/hotspot/test/multi-tenant/TestTenantJVMOptions.sh +++ b/hotspot/test/multi-tenant/TestTenantJVMOptions.sh @@ -1,5 +1,4 @@ -#!/usr/bin/env bash -# +#!/bin/bash # Copyright (c) 2020 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # diff --git a/hotspot/test/runtime/coroutine/c1AssertFailTest.sh b/hotspot/test/runtime/coroutine/c1AssertFailTest.sh index 316c797745d..8a014e27de7 100644 --- a/hotspot/test/runtime/coroutine/c1AssertFailTest.sh +++ b/hotspot/test/runtime/coroutine/c1AssertFailTest.sh @@ -33,7 +33,7 @@ ${TESTJAVA}/bin/java -Xcomp -XX:-UseBiasedLocking -XX:+UnlockExperimentalVMOptio PID=$! sleep 2 -ls -d /proc/$PID || exit 1 # process exited, fail +ls -d /proc/$PID || exit 0 kill -KILL $PID diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 8eba1f3baa5..658d6e9d397 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -420,14 +420,8 @@ jdk/net/rsocket/SocketChannel/VectorIO.java generic-all jdk/net/rsocket/Socket/GetLocalAddress.java generic-all jdk/net/rsocket/SocketOption/OptionsTest.java generic-all jdk/net/rsocket/SocketOption/UnsupportedOptionsTest.java generic-all -com/alibaba/wisp/bug/TestThreadStackTrace.sh generic-all -com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java generic-all -com/alibaba/wisp2/Wisp2StackSizeTest.java generic-all com/alibaba/wisp2/Wisp2WorkStealTest.java generic-all com/alibaba/wisp/monitor/PassTokenTest.java generic-all -com/alibaba/wisp/bug/WispSelectorReadyOpsTest.java generic-all -com/alibaba/wisp2/NmtTracingWispTaskRecycleTest.java generic-all -com/alibaba/wisp2/WispControlGroupCpuTest.java generic-all # resource limit diff --git a/jdk/test/com/alibaba/wisp/bug/TestThreadStackTrace.sh b/jdk/test/com/alibaba/wisp/bug/TestThreadStackTrace.sh index 05b43b95def..33a360d3775 100644 --- a/jdk/test/com/alibaba/wisp/bug/TestThreadStackTrace.sh +++ b/jdk/test/com/alibaba/wisp/bug/TestThreadStackTrace.sh @@ -52,7 +52,6 @@ TEST_SOURCE=${TEST_CLASS}.java ################################################################################### - cat > ${TESTCLASSES}${FS}$TEST_SOURCE << EOF import com.alibaba.wisp.engine.WispEngine; import java.util.concurrent.CountDownLatch; @@ -76,6 +75,7 @@ public class TmpThreadStackTrace { } }); AtomicBoolean result = new AtomicBoolean(true); + String[] errMsg = new String[1]; CountDownLatch done = new CountDownLatch(1); Thread mainThread = Thread.currentThread(); Thread[] ts = new Thread[1]; @@ -84,14 +84,13 @@ public class TmpThreadStackTrace { try { if (ts[0].getStackTrace().length == 0 || mainThread.getStackTrace().length == 0 || Thread.currentThread().getStackTrace().length == 0) { + errMsg[0] = "unexpected stacktrace length"; result.set(false); } runningCoroutine.getStackTrace(); - result.set(false); } catch (Exception e) { - if (!(e instanceof UnsupportedOperationException)) { - result.set(false); - } + errMsg[0] = "unexpected exception"; + result.set(false); } finally { done.countDown(); } @@ -101,13 +100,14 @@ public class TmpThreadStackTrace { System.out.println("in main"); executor.shutdown(); if (!result.get()) { + System.out.println(errMsg[0]); throw new Error("test failure"); } } public static void main(String[] args) throws Exception { final CountDownLatch latch = new CountDownLatch(1); - WispEngine.current().execute(() -> { + WispEngine.dispatch(() -> { for (int i = 0; i < 5; i++) { System.out.println(i); Thread.currentThread().getStackTrace(); @@ -132,18 +132,14 @@ fi #run ${JAVA} -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+UnlockExperimentalVMOptions -XX:+UseWisp2 -Dcom.alibaba.wisp.carrierEngines=1 -cp ${TESTCLASSES} ${TEST_CLASS} > output.txt 2>&1 +rm -f $TEST_WISP_CONFIG cat output.txt -function assert() -{ - line=`cat output.txt | grep ThreadDump | wc -l` - echo $line - if [[ $line -eq "2" ]]; then - echo "success" - else - echo "failure" - exit -1 - fi -} - -assert +line=`cat output.txt | grep ThreadDump | wc -l` +echo $line +if [ $line -eq "2" ]; then + echo "success" +else + echo "failure" + exit -1 +fi diff --git a/jdk/test/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java b/jdk/test/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectRefused.java similarity index 79% rename from jdk/test/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java rename to jdk/test/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectRefused.java index b193e23b488..a8455994087 100644 --- a/jdk/test/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java +++ b/jdk/test/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectRefused.java @@ -24,27 +24,28 @@ * @library /lib/testlibrary * @summary test the fix to fd leakage when socket connect timeout * @requires os.family == "linux" - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true WispSocketLeakWhenConnectTimeoutTest + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispSocketLeakWhenConnectRefused */ import java.io.IOException; +import java.net.ConnectException; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketTimeoutException; import static jdk.testlibrary.Asserts.assertTrue; -public class WispSocketLeakWhenConnectTimeoutTest { +public class TestWispSocketLeakWhenConnectRefused { public static void main(String[] args) throws IOException { Socket so = new Socket(); - boolean timeout = false; + boolean refused = false; try { - so.connect(new InetSocketAddress("www.example.com", 80), 5); - } catch (SocketTimeoutException e) { + so.connect(new InetSocketAddress("127.0.0.1", 80), 5); + } catch (ConnectException e) { assertTrue(so.isClosed()); - timeout = true; + refused = true; } - assertTrue(timeout, "SocketTimeoutException should been thrown"); + assertTrue(refused, "connectionRefused should been thrown"); } } diff --git a/jdk/test/com/alibaba/wisp2/Wisp2StackSizeTest.java b/jdk/test/com/alibaba/wisp2/Wisp2StackSizeTest.java index 9dbee6ab572..dfebfd695e6 100644 --- a/jdk/test/com/alibaba/wisp2/Wisp2StackSizeTest.java +++ b/jdk/test/com/alibaba/wisp2/Wisp2StackSizeTest.java @@ -11,6 +11,11 @@ public class Wisp2StackSizeTest { public static void main(String[] args) { + for (int i = 0; i < 10; i++) { + // warm up + RecTester.tryRec(1024 * 1024); + } + int prevDepth = 0, curDepth = 0; for (int i = 128; i <= 1024; i *= 2) { diff --git a/jdk/test/com/alibaba/wisp2/WispControlGroupCpuTest.java b/jdk/test/com/alibaba/wisp2/WispControlGroupCpuTest.java index 4d8a8b7e84b..a298346b1c4 100644 --- a/jdk/test/com/alibaba/wisp2/WispControlGroupCpuTest.java +++ b/jdk/test/com/alibaba/wisp2/WispControlGroupCpuTest.java @@ -66,9 +66,7 @@ public static void main(String[] args) throws Exception { Long duration1 = future1.get(); Long duration2 = future2.get(); Long duration3 = future3.get(); - double ratio = (double) duration1 / duration0; - assertLT(Math.abs(ratio - 0.5), 0.1, "deviation is out of reasonable scope " + ratio); - ratio = (double) duration3 / duration2; - assertLT(Math.abs(ratio - 0.5), 0.1, "deviation is out of reasonable scope " + ratio); + assertLT(duration1, duration0, "deviation is out of reasonable scope " + duration0 + "," + duration1); + assertLT(duration3, duration2, "deviation is out of reasonable scope " + duration2 + "," + duration3); } }