Skip to content

Commit 6ace28f

Browse files
authored
Merge pull request #19086 from JasonFengJ9/criutest-v0.44
(v0.44.0-release) CRIU time compensation tests reset TestResult.lockStatus
2 parents d786bbb + f109d10 commit 6ace28f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/functional/cmdLineTests/criu/src/org/openj9/criu/CRIUTestUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ public static void checkPointJVMNoSetup(CRIUSupport criu, Path path, boolean del
113113
}
114114

115115
public static void showThreadCurrentTime(String logStr) {
116-
System.out.println(logStr + ", current thread name: " + Thread.currentThread().getName() + ", " + new Date()
117-
+ ", System.currentTimeMillis(): " + System.currentTimeMillis() + ", System.nanoTime(): "
118-
+ System.nanoTime());
116+
System.out.println(Thread.currentThread().getName() + ": " + new Date() + ", " + logStr
117+
+ ", System.currentTimeMillis(): " + System.currentTimeMillis()
118+
+ ", System.nanoTime(): " + System.nanoTime());
119119
}
120120

121121

test/functional/cmdLineTests/criu/src/org/openj9/criu/JDK11UpTimeoutAdjustmentTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*******************************************************************************/
2222
package org.openj9.criu;
2323

24+
import java.util.Date;
2425
import jdk.internal.misc.Unsafe;
2526
import openj9.internal.criu.InternalCRIUSupport;
2627
import org.eclipse.openj9.criu.CRIUSupport;
@@ -57,21 +58,25 @@ private void test(String testName) throws InterruptedException {
5758
switch (testName) {
5859
case "testThreadPark":
5960
testThreadParkHelper("testThreadPark NO C/R");
61+
testResult.lockStatus.set(0);
6062
testThread = testThreadPark();
6163
break;
6264
case "testThreadSleep":
6365
testThreadSleepHelper("testThreadSleep NO C/R");
66+
testResult.lockStatus.set(0);
6467
testThread = testThreadSleep();
6568
break;
6669
case "testObjectWaitNotify":
6770
testThread = testObjectWaitNotify();
6871
break;
6972
case "testObjectWaitTimedNoNanoSecond":
7073
testObjectWaitTimedHelper("testObjectWaitTimedNoNanoSecond NO C/R", msTime2s, 0);
74+
testResult.lockStatus.set(0);
7175
testThread = testObjectWaitTimedNoNanoSecond();
7276
break;
7377
case "testObjectWaitTimedWithNanoSecond":
7478
testObjectWaitTimedHelper("testObjectWaitTimedWithNanoSecond NO C/R", msTime2s, nsTime500kns);
79+
testResult.lockStatus.set(0);
7580
testThread = testObjectWaitTimedWithNanoSecond();
7681
break;
7782
default:
@@ -129,7 +134,8 @@ private void test(String testName) throws InterruptedException {
129134
public static void showMessages(String logStr, long expectedTime, boolean isMillis, long elapsedTime,
130135
long startNanoTime, long endNanoTime) {
131136
long crDeltaNs = InternalCRIUSupport.getCheckpointRestoreNanoTimeDelta();
132-
System.out.println(logStr + expectedTime + " " + (isMillis ? "ms" : "ns")
137+
System.out.println(Thread.currentThread().getName() + ": " + new Date() + ", "
138+
+ logStr + expectedTime + " " + (isMillis ? "ms" : "ns")
133139
+ ", but the actual elapsed time was: " + elapsedTime + "ns (~" + (elapsedTime / NANOS_PER_MILLI)
134140
+ "ms) with startNanoTime = " + startNanoTime + "ns, and endNanoTime = " + endNanoTime
135141
+ "ns, CheckpointRestoreNanoTimeDelta: " + crDeltaNs + "ns (~" + (crDeltaNs / NANOS_PER_MILLI) + "ms)");

0 commit comments

Comments
 (0)