From a1cc06ce973efab95f9b1e245d1a1dca9724e2ed Mon Sep 17 00:00:00 2001 From: Cheng Pan <379377944@qq.com> Date: Sun, 13 Jun 2021 23:15:51 +0800 Subject: [PATCH] [KYUUBI #689] Fix MetricsSystemSuite on JDK 11 ### _Why are the changes needed?_ Fix #689. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request Closes #690 from pan3793/689. Closes #689 bd64a666 [Cheng Pan] Revert "[GA] Enable JDK 11 in GA" ab103cf3 [Cheng Pan] [GA] Enable JDK 11 in GA 1762f92b [Cheng Pan] Fix MetricsSystemSuite on G1 Authored-by: Cheng Pan <379377944@qq.com> Signed-off-by: Kent Yao --- .../scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kyuubi-metrics/src/test/scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala b/kyuubi-metrics/src/test/scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala index dac09cd79..077b646bb 100644 --- a/kyuubi-metrics/src/test/scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala +++ b/kyuubi-metrics/src/test/scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala @@ -64,7 +64,7 @@ class MetricsSystemSuite extends KyuubiFunSuite { val client: HttpClient = new HttpClient client.start() val res: ContentResponse = client.GET(prometheusHttpServer.getURI.resolve(testContextPath)) - assert(res.getContentAsString.contains("PS_MarkSweep_count")) + assert(res.getContentAsString.contains("heap_usage")) assert(res.getContentAsString.contains("kyuubi_connection_opened 2021.0")) client.stop() @@ -83,7 +83,7 @@ class MetricsSystemSuite extends KyuubiFunSuite { metricsSystem.initialize(conf) metricsSystem.start() val reportFile = Paths.get(reportPath.toString, "report.json") - checkJsonFileMetrics(reportFile, "PS-MarkSweep.count") + checkJsonFileMetrics(reportFile, "heap.usage") metricsSystem.incCount(MetricsConstants.STATEMENT_TOTAL) checkJsonFileMetrics(reportFile, MetricsConstants.STATEMENT_TOTAL)