You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "reswqa (via GitHub)" <gi...@apache.org> on 2023/03/13 15:23:48 UTC

[GitHub] [flink] reswqa opened a new pull request, #22171: [FLINK-31420] Fix unstable test ThreadInfoRequestCoordinatorTest.

reswqa opened a new pull request, #22171:
URL: https://github.com/apache/flink/pull/22171

   ## What is the purpose of the change
   
   *`ThreadInfoRequestCoordinatorTest#testShutDown` using two gateways contains a `timeout gateway` but expected all `request futures` not done before `shutdown`. If the timeout reached, this future will be failed, result in `request futures` to be done. This makes the test strongly dependent on the execution order of assertion and timeout, thus causing this test unstable.*
   
   
   ## Brief change log
   
     - *Let ThreadInfoRequestCoordinatorTest more comply with the specifications of Junit and AssertJ.*
     - *Fix unstable test ThreadInfoRequestCoordinatorTest#testShutDown..*
   
   ## Verifying this change
   
   This change is dedicated to fixing an unstable test.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
   


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


[GitHub] [flink] reswqa commented on pull request #22171: [FLINK-31420][test] Fix unstable test ThreadInfoRequestCoordinatorTest.

Posted by "reswqa (via GitHub)" <gi...@apache.org>.
reswqa commented on PR #22171:
URL: https://github.com/apache/flink/pull/22171#issuecomment-1469694591

   Merged after CI green.


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


[GitHub] [flink] WencongLiu commented on a diff in pull request #22171: [FLINK-31420][test] Fix unstable test ThreadInfoRequestCoordinatorTest.

Posted by "WencongLiu (via GitHub)" <gi...@apache.org>.
WencongLiu commented on code in PR #22171:
URL: https://github.com/apache/flink/pull/22171#discussion_r1135465877


##########
flink-runtime/src/test/java/org/apache/flink/runtime/webmonitor/threadinfo/ThreadInfoRequestCoordinatorTest.java:
##########
@@ -164,25 +160,22 @@ public void testThreadInfoRequestTimeout() throws Exception {
                         DEFAULT_MAX_STACK_TRACE_DEPTH);
 
         try {
-            requestFuture.get();
-            fail("Exception expected.");
-        } catch (ExecutionException e) {
-            assertThat(
-                            ExceptionUtils.findThrowableWithMessage(e, REQUEST_TIMEOUT_MESSAGE)
-                                    .isPresent())
-                    .isTrue();
+            assertThatThrownBy(requestFuture::get, "Exception expected.")

Review Comment:
   Same with last one.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/webmonitor/threadinfo/ThreadInfoRequestCoordinatorTest.java:
##########
@@ -140,17 +139,14 @@ public void testThreadInfoRequestWithException() throws Exception {
                         DEFAULT_DELAY_BETWEEN_SAMPLES,
                         DEFAULT_MAX_STACK_TRACE_DEPTH);
 
-        try {
-            requestFuture.get();
-            fail("Exception expected.");
-        } catch (ExecutionException e) {
-            assertThat(e.getCause()).isInstanceOf(RuntimeException.class);
-        }
+        assertThatThrownBy(requestFuture::get, "Exception expected.")

Review Comment:
   Maybe "The request must be failed." is more suitable? For this version, If the requestFuture is completed successfully, there will be a exception like this:
   
   java.lang.AssertionError: [Exception expected.] 
   Expecting code to raise a throwable.



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


[GitHub] [flink] reswqa commented on pull request #22171: [FLINK-31420][test] Fix unstable test ThreadInfoRequestCoordinatorTest.

Posted by "reswqa (via GitHub)" <gi...@apache.org>.
reswqa commented on PR #22171:
URL: https://github.com/apache/flink/pull/22171#issuecomment-1468219352

   Thanks @WencongLiu for the review, I have address your comments in a fix-up commit, please take a look again.


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


[GitHub] [flink] flinkbot commented on pull request #22171: [FLINK-31420][test] Fix unstable test ThreadInfoRequestCoordinatorTest.

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #22171:
URL: https://github.com/apache/flink/pull/22171#issuecomment-1466367972

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4b1a56e806a42eae0a4b6915b1290d50179321f9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4b1a56e806a42eae0a4b6915b1290d50179321f9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4b1a56e806a42eae0a4b6915b1290d50179321f9 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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


[GitHub] [flink] reswqa merged pull request #22171: [FLINK-31420][test] Fix unstable test ThreadInfoRequestCoordinatorTest.

Posted by "reswqa (via GitHub)" <gi...@apache.org>.
reswqa merged PR #22171:
URL: https://github.com/apache/flink/pull/22171


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