This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch 2.7
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.7 by this push:
     new 959b310  MINOR: Adjust parameter ordering of `waitForCondition` and 
`retryOnExceptionWithTimeout` (#10777)
959b310 is described below

commit 959b3101220599f7168282504d76d42f60df9e16
Author: Ismael Juma <[email protected]>
AuthorDate: Thu May 27 09:58:50 2021 -0700

    MINOR: Adjust parameter ordering of `waitForCondition` and 
`retryOnExceptionWithTimeout` (#10777)
    
    New parameters in overloaded methods should appear later apart from
    lambdas that should always be last.
    
    Reviewers: Chia-Ping Tsai <[email protected]>
---
 clients/src/test/java/org/apache/kafka/test/TestUtils.java     | 10 +++++-----
 .../streams/integration/OptimizedKTableIntegrationTest.java    |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/clients/src/test/java/org/apache/kafka/test/TestUtils.java 
b/clients/src/test/java/org/apache/kafka/test/TestUtils.java
index 383c550..bd98e97 100644
--- a/clients/src/test/java/org/apache/kafka/test/TestUtils.java
+++ b/clients/src/test/java/org/apache/kafka/test/TestUtils.java
@@ -413,7 +413,7 @@ public class TestUtils {
      */
     public static void retryOnExceptionWithTimeout(final long timeoutMs,
                                                    final ValuelessCallable 
runnable) throws InterruptedException {
-        retryOnExceptionWithTimeout(DEFAULT_POLL_INTERVAL_MS, timeoutMs, 
runnable);
+        retryOnExceptionWithTimeout(timeoutMs, DEFAULT_POLL_INTERVAL_MS, 
runnable);
     }
 
     /**
@@ -425,7 +425,7 @@ public class TestUtils {
      * @throws InterruptedException if the current thread is interrupted while 
waiting for {@code runnable} to complete successfully.
      */
     public static void retryOnExceptionWithTimeout(final ValuelessCallable 
runnable) throws InterruptedException {
-        retryOnExceptionWithTimeout(DEFAULT_POLL_INTERVAL_MS, 
DEFAULT_MAX_WAIT_MS, runnable);
+        retryOnExceptionWithTimeout(DEFAULT_MAX_WAIT_MS, 
DEFAULT_POLL_INTERVAL_MS, runnable);
     }
 
     /**
@@ -433,13 +433,13 @@ public class TestUtils {
      * {@link AssertionError}s, or for the given timeout to expire. If the 
timeout expires then the
      * last exception or assertion failure will be thrown thus providing 
context for the failure.
      *
-     * @param pollIntervalMs the interval in milliseconds to wait between 
invoking {@code runnable}.
      * @param timeoutMs the total time in milliseconds to wait for {@code 
runnable} to complete successfully.
+     * @param pollIntervalMs the interval in milliseconds to wait between 
invoking {@code runnable}.
      * @param runnable the code to attempt to execute successfully.
      * @throws InterruptedException if the current thread is interrupted while 
waiting for {@code runnable} to complete successfully.
      */
-    public static void retryOnExceptionWithTimeout(final long pollIntervalMs,
-                                                   final long timeoutMs,
+    public static void retryOnExceptionWithTimeout(final long timeoutMs,
+                                                   final long pollIntervalMs,
                                                    final ValuelessCallable 
runnable) throws InterruptedException {
         final long expectedEnd = System.currentTimeMillis() + timeoutMs;
 
diff --git 
a/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java
 
b/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java
index cefb712..933e7c3 100644
--- 
a/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java
+++ 
b/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java
@@ -134,7 +134,7 @@ public class OptimizedKTableIntegrationTest {
         }
 
         final ReadOnlyKeyValueStore<Integer, Integer> newActiveStore = 
kafkaStreams1WasFirstActive ? store2 : store1;
-        TestUtils.retryOnExceptionWithTimeout(100, 60 * 1000, () -> {
+        TestUtils.retryOnExceptionWithTimeout(60 * 1000, 100, () -> {
             // Assert that after failover we have recovered to the last store 
write
             assertThat(newActiveStore.get(key), is(equalTo(batch1NumMessages - 
1)));
         });
@@ -146,7 +146,7 @@ public class OptimizedKTableIntegrationTest {
         // Assert that all messages in the second batch were processed in a 
timely manner
         assertThat(semaphore.tryAcquire(batch2NumMessages, 60, 
TimeUnit.SECONDS), is(equalTo(true)));
 
-        TestUtils.retryOnExceptionWithTimeout(100, 60 * 1000, () -> {
+        TestUtils.retryOnExceptionWithTimeout(60 * 1000, 100, () -> {
             // Assert that the current value in store reflects all messages 
being processed
             assertThat(newActiveStore.get(key), is(equalTo(totalNumMessages - 
1)));
         });

Reply via email to