You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/06 12:27:24 UTC

[GitHub] [flink] zentol commented on a diff in pull request #20157: [FLINK-28326][runtime] fix unstable test ResultPartitionTest.testIdleAndBackPressuredTime.

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


##########
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:
   ```suggestion
           while (!isInBlockingBufferRequest(requestThread.getStackTrace()) {
                   Thread.sleep(50);
            }
   ```



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org