From 19155d49bc435944eb9b4aa39a3cb4da79ff2d0b Mon Sep 17 00:00:00 2001 From: herefree <841043203@qq.com> Date: Tue, 26 Nov 2024 17:42:47 +0800 Subject: [PATCH] fix --- .../FileStoreSourceReaderMetricsTest.java | 2 +- .../source/operator/OperatorSourceTest.java | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/metrics/FileStoreSourceReaderMetricsTest.java b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/metrics/FileStoreSourceReaderMetricsTest.java index 2eb34dcc7bd7..ed43cd0cd237 100644 --- a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/metrics/FileStoreSourceReaderMetricsTest.java +++ b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/metrics/FileStoreSourceReaderMetricsTest.java @@ -66,7 +66,7 @@ public void testSourceIdleTimeUpdated() throws InterruptedException { Thread.sleep(10L); assertThat(sourceReaderMetrics.getIdleTime()).isGreaterThan(9L); - //non-idle + // non-idle sourceReaderMetrics.recordSnapshotUpdate(123); Thread.sleep(10L); assertThat(sourceReaderMetrics.getIdleTime()).isEqualTo(0L); diff --git a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/operator/OperatorSourceTest.java b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/operator/OperatorSourceTest.java index c5abe5eb32a4..0bce8c8901ea 100644 --- a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/operator/OperatorSourceTest.java +++ b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/source/operator/OperatorSourceTest.java @@ -205,9 +205,12 @@ public void testReadOperatorMetricsRegisterAndUpdate() throws Exception { .isEqualTo(-1L); Thread.sleep(300L); - assertThat((Long)TestingMetricUtils.getGauge( - readerOperatorMetricGroup, "sourceIdleTime") - .getValue()).isGreaterThan(299L); + assertThat( + (Long) + TestingMetricUtils.getGauge( + readerOperatorMetricGroup, "sourceIdleTime") + .getValue()) + .isGreaterThan(299L); harness.processElement(new StreamRecord<>(splits.get(0))); assertThat( @@ -234,10 +237,13 @@ public void testReadOperatorMetricsRegisterAndUpdate() throws Exception { .getValue()) .isEqualTo(emitEventTimeLag); - assertThat((Long)TestingMetricUtils.getGauge( - readerOperatorMetricGroup, "sourceIdleTime") - .getValue()).isGreaterThan(99L).isLessThan(300L); - + assertThat( + (Long) + TestingMetricUtils.getGauge( + readerOperatorMetricGroup, "sourceIdleTime") + .getValue()) + .isGreaterThan(99L) + .isLessThan(300L); } private T testReadSplit(