Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
herefree committed Nov 26, 2024
1 parent cb9f852 commit 19155d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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> T testReadSplit(
Expand Down

0 comments on commit 19155d4

Please sign in to comment.