reswqa commented on code in PR #20157:
URL: https://github.com/apache/flink/pull/20157#discussion_r914982785


##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java:
##########
@@ -405,20 +395,37 @@ public void testIdleAndBackPressuredTime() throws 
IOException, InterruptedExcept
         // wait until request thread start to run.
         syncLock.await();
 
-        Thread.sleep(100);
+        // wait until request buffer blocking.
+        boolean bufferPoolBlocking = false;
+
+        for (int i = 0; i < 50; i++) {
+            StackTraceElement[] stackTrace = requestThread.getStackTrace();
+            bufferPoolBlocking = isInBlockingBufferRequest(stackTrace);
+
+            if (bufferPoolBlocking) {
+                break;
+            } else {
+                // Retry
+                Thread.sleep(500);
+            }
+        }
+
+        // Verify that Thread was in blocking request
+        assertThat(bufferPoolBlocking)
+                .isTrue()
+                .withFailMessage("Did not trigger blocking buffer request.");

Review Comment:
   Thanks for your review @zentol, we must add timeout to this test if it is 
modified like your suggestion, right?



-- 
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]

Reply via email to