提交 5cf37782 编写于 作者: P Piotr Nowojski 提交者: Stefan Richter

[FLINK-8209][network-tests] Make LocalBufferPoolDestroyTest less implementation dependent

上级 97db0bf9
......@@ -104,11 +104,10 @@ public class LocalBufferPoolDestroyTest {
* @return Flag indicating whether the Thread is in a blocking buffer
* request or not
*/
private boolean isInBlockingBufferRequest(StackTraceElement[] stackTrace) {
public static boolean isInBlockingBufferRequest(StackTraceElement[] stackTrace) {
if (stackTrace.length >= 3) {
return stackTrace[0].getMethodName().equals("wait") &&
stackTrace[1].getMethodName().equals("requestBuffer") &&
stackTrace[2].getMethodName().equals("requestBufferBlocking");
stackTrace[1].getClassName().equals(LocalBufferPool.class.getName());
} else {
return false;
}
......
......@@ -38,15 +38,18 @@ import org.apache.flink.runtime.testingUtils.TestingJobManagerMessages.NotifyWhe
import org.apache.flink.runtime.testingUtils.TestingJobManagerMessages.WaitForAllVerticesToBeRunning;
import org.apache.flink.types.LongValue;
import org.apache.flink.util.TestLogger;
import org.junit.Test;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import scala.concurrent.Await;
import scala.concurrent.Future;
import scala.concurrent.duration.Deadline;
import scala.concurrent.duration.FiniteDuration;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import static org.apache.flink.runtime.io.network.buffer.LocalBufferPoolDestroyTest.isInBlockingBufferRequest;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
......@@ -171,21 +174,6 @@ public class TaskCancelAsyncProducerConsumerITCase extends TestLogger {
}
}
/**
* Returns whether the stack trace represents a Thread in a blocking buffer
* request.
*
* @param stackTrace Stack trace of the Thread to check
*
* @return Flag indicating whether the Thread is in a blocking buffer
* request or not
*/
private boolean isInBlockingBufferRequest(StackTraceElement[] stackTrace) {
return stackTrace.length >= 3 && stackTrace[0].getMethodName().equals("wait") &&
stackTrace[1].getMethodName().equals("requestBuffer") &&
stackTrace[2].getMethodName().equals("requestBufferBlocking");
}
/**
* Invokable emitting records in a separate Thread (not the main Task
* thread).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册