8202466: Test serviceability/tmtools/jstat/GcTest01.java fails: Number of concurrent GC events is 1, but CGCT is 0

Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
Yasumasa Suenaga 2018-05-20 20:25:51 +09:00
parent 09e8095fd9
commit 535c2507a0
4 changed files with 8 additions and 26 deletions

View File

@ -66,9 +66,6 @@ public class JstatGcCauseResults extends JstatResults {
int YGC = getIntValue("YGC"); int YGC = getIntValue("YGC");
float YGCT = getFloatValue("YGCT"); float YGCT = getFloatValue("YGCT");
assertThat(YGCT >= 0, "Incorrect time value for YGCT"); assertThat(YGCT >= 0, "Incorrect time value for YGCT");
if (YGC > 0) {
assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0");
}
float GCT = getFloatValue("GCT"); float GCT = getFloatValue("GCT");
assertThat(GCT >= 0, "Incorrect time value for GCT"); assertThat(GCT >= 0, "Incorrect time value for GCT");
@ -86,15 +83,11 @@ public class JstatGcCauseResults extends JstatResults {
if (CGC > 0) { if (CGC > 0) {
CGCT = getFloatValue("CGCT"); CGCT = getFloatValue("CGCT");
assertThat(CGCT >= 0, "Incorrect time value for CGCT"); assertThat(CGCT >= 0, "Incorrect time value for CGCT");
assertThat(CGCT > 0, "Number of concurrent GC events is " + CGC + ", but CGCT is 0");
} }
int FGC = getIntValue("FGC"); int FGC = getIntValue("FGC");
float FGCT = getFloatValue("FGCT"); float FGCT = getFloatValue("FGCT");
assertThat(FGCT >= 0, "Incorrect time value for FGCT"); assertThat(FGCT >= 0, "Incorrect time value for FGCT");
if (FGC > 0) {
assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0");
}
assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,8 @@
* Results of running the JstatGcTool ("jstat -gcnew <pid>") * Results of running the JstatGcTool ("jstat -gcnew <pid>")
* *
* Output example: * Output example:
* S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT * S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
* 11264.0 11264.0 0.0 0.0 15 15 0.0 67584.0 1351.7 0 0.000 * 0.0 7168.0 0.0 7168.0 15 15 3584.0 62464.0 5120.0 27 0.340
* Output description: * Output description:
* S0C Current survivor space 0 capacity (KB). * S0C Current survivor space 0 capacity (KB).
@ -77,10 +77,6 @@ public class JstatGcNewResults extends JstatResults {
int YGC = getIntValue("YGC"); int YGC = getIntValue("YGC");
float YGCT = getFloatValue("YGCT"); float YGCT = getFloatValue("YGCT");
if (YGC > 0) {
assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0");
}
int TT = getIntValue("TT"); int TT = getIntValue("TT");
int MTT = getIntValue("MTT"); int MTT = getIntValue("MTT");
assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)"); assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)");

View File

@ -95,9 +95,6 @@ public class JstatGcResults extends JstatResults {
int YGC = getIntValue("YGC"); int YGC = getIntValue("YGC");
float YGCT = getFloatValue("YGCT"); float YGCT = getFloatValue("YGCT");
assertThat(YGCT >= 0, "Incorrect time value for YGCT"); assertThat(YGCT >= 0, "Incorrect time value for YGCT");
if (YGC > 0) {
assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0");
}
float GCT = getFloatValue("GCT"); float GCT = getFloatValue("GCT");
assertThat(GCT >= 0, "Incorrect time value for GCT"); assertThat(GCT >= 0, "Incorrect time value for GCT");
@ -115,15 +112,11 @@ public class JstatGcResults extends JstatResults {
if (CGC > 0) { if (CGC > 0) {
CGCT = getFloatValue("CGCT"); CGCT = getFloatValue("CGCT");
assertThat(CGCT >= 0, "Incorrect time value for CGCT"); assertThat(CGCT >= 0, "Incorrect time value for CGCT");
assertThat(CGCT > 0, "Number of concurrent GC events is " + CGC + ", but CGCT is 0");
} }
int FGC = getIntValue("FGC"); int FGC = getIntValue("FGC");
float FGCT = getFloatValue("FGCT"); float FGCT = getFloatValue("FGCT");
assertThat(FGCT >= 0, "Incorrect time value for FGCT"); assertThat(FGCT >= 0, "Incorrect time value for FGCT");
if (FGC > 0) {
assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0");
}
assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -109,12 +109,12 @@ abstract public class JstatResults extends ToolResults {
* measurements * measurements
* *
* @param measurement1 -first measurement * @param measurement1 -first measurement
* @param measurement2 -first measurement * @param measurement2 -second measurement
*/ */
public static void assertGCTimeIncreased(JstatResults measurement1, JstatResults measurement2) { public static void assertGCTimeIncreased(JstatResults measurement1, JstatResults measurement2) {
assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); assertThat(measurement2.getFloatValue("YGCT") >= measurement1.getFloatValue("YGCT"), "YGCT time rewinded between measurements 1 and 2");
assertThat(measurement2.getFloatValue("FGCT") > measurement1.getFloatValue("FGCT"), "FGCT time didn't increase between measurements 1 and 2"); assertThat(measurement2.getFloatValue("FGCT") >= measurement1.getFloatValue("FGCT"), "FGCT time rewinded between measurements 1 and 2");
assertThat(measurement2.getFloatValue("GCT") > measurement1.getFloatValue("GCT"), "GCT time didn't increase between measurements 1 and 2"); assertThat(measurement2.getFloatValue("GCT") >= measurement1.getFloatValue("GCT"), "GCT time rewinded between measurements 1 and 2");
} }
/** /**