dant3 commented on code in PR #7250:
URL: https://github.com/apache/ignite-3/pull/7250#discussion_r2651367085
##########
modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointTimeoutLockTest.java:
##########
@@ -407,4 +417,46 @@ private Checkpointer newCheckpointer(Thread runner,
CompletableFuture<?> future)
return checkpointer;
}
+
+ @Test
+ void testCheckpointReadLockMetrics() throws Exception {
+ CheckpointMetricSource metricSource = new
CheckpointMetricSource("test");
+ CheckpointReadWriteLockMetrics metrics = new
CheckpointReadWriteLockMetrics(metricSource);
+ CheckpointReadWriteLock readWriteLock = newReadWriteLock(metrics);
+
+ timeoutLock = new CheckpointTimeoutLock(
+ readWriteLock,
+ 10_000,
+ () -> NOT_REQUIRED,
+ mock(Checkpointer.class),
+ mock(FailureManager.class)
+ );
+
+ timeoutLock.start();
+
+ try {
+ // Verify metrics start at zero
+
assertTrue(Arrays.stream(metrics.readLockAcquisitionTime().value()).allMatch(it
-> it == 0L));
Review Comment:
There is such an assertion, but it also means we make assumptions about
specific buckets and which one this measure will land in. I don't feel it right
to make such a bold assumptions and its obvious it can make the test flaky
really easy, just imagine it running on a slow busy agent and the measure hits
different distribution bucket and not the one we expect. Here we explicitly
assert that none of the buckets contains the measurement, or that only one of
the bucket contains a single measurement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]