HuangZhenQiu commented on code in PR #26640:
URL: https://github.com/apache/flink/pull/26640#discussion_r2174965135
##########
flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/state/rocksdb/RocksDBStateUploaderTest.java:
##########
@@ -233,6 +238,28 @@ void testMultiThreadUploadCorrectly() throws Exception {
}
}
+ @Test
+ void testApplyJitter() throws Exception {
+ try (RocksDBStateUploader rocksDBStateUploader =
+ new RocksDBStateUploader(1, Duration.ofMillis(1000L))) {
+ rocksDBStateUploader.applyJitter(
+ sleepTime -> {
+ assertThat(sleepTime).isGreaterThan(0);
+ assertThat(sleepTime).isLessThanOrEqualTo(1000);
+ });
+ }
+ }
+
+ @Test
+ void testApplyDefaultJitter() throws Exception {
+ try (RocksDBStateUploader rocksDBStateUploader =
+ new RocksDBStateUploader(1, Duration.ZERO)) {
+
+ // If it is configured as Zero, the consumer function shouldn't be
called
Review Comment:
The "shouldn't" is to explain why apply jitter shouldn't be called otherwise
the test case will fail.
--
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]