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 2021/11/23 14:13:01 UTC
[GitHub] [flink] XComp commented on a change in pull request #17857: [FLINK-24985][tests] Relax assumptions of stacktrace layout
XComp commented on a change in pull request #17857:
URL: https://github.com/apache/flink/pull/17857#discussion_r755157198
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPoolDestroyTest.java
##########
@@ -119,8 +119,15 @@ public void testDestroyWhileBlockingRequest() throws Exception {
*/
public static boolean isInBlockingBufferRequest(StackTraceElement[] stackTrace) {
if (stackTrace.length >= 8) {
- return stackTrace[5].getMethodName().equals("get")
- && stackTrace[7].getClassName().equals(LocalBufferPool.class.getName());
+ 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;
Review comment:
That return could be moved outside of the if block if its else branch is removed as well. ¯\_(ツ)_/¯
--
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