You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2021/11/24 09:21:17 UTC
[flink] branch master updated: [FLINK-24985][tests] Relax assumptions of stacktrace layout
This is an automated email from the ASF dual-hosted git repository.
chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new cd4f7ea [FLINK-24985][tests] Relax assumptions of stacktrace layout
cd4f7ea is described below
commit cd4f7ea9c4b2592557fdb53cb486671cb18ddbb0
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Wed Nov 24 10:20:58 2021 +0100
[FLINK-24985][tests] Relax assumptions of stacktrace layout
---
.../io/network/buffer/LocalBufferPoolDestroyTest.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolDestroyTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolDestroyTest.java
index 647c4de..87f9ebf3 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolDestroyTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolDestroyTest.java
@@ -119,11 +119,16 @@ public class LocalBufferPoolDestroyTest {
*/
public static boolean isInBlockingBufferRequest(StackTraceElement[] stackTrace) {
if (stackTrace.length >= 8) {
- return stackTrace[5].getMethodName().equals("get")
- && stackTrace[7].getClassName().equals(LocalBufferPool.class.getName());
- } else {
- return false;
+ for (int x = 0; x < stackTrace.length - 2; x++) {
+ if (stackTrace[x].getMethodName().equals("get")
+ && stackTrace[x + 2]
+ .getClassName()
+ .equals(LocalBufferPool.class.getName())) {
+ return true;
+ }
+ }
}
+ return false;
}
/** Task triggering a blocking buffer request (the test assumes that no buffer is available). */