zentol commented on a change in pull request #11639: [FLINK-16626][runtime] 
Prevent REST handler from being closed more than once
URL: https://github.com/apache/flink/pull/11639#discussion_r404582030
 
 

 ##########
 File path: 
flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
 ##########
 @@ -271,6 +273,24 @@ public void testDetachedJobSubmission() throws Exception {
 
        }
 
+       /**
+        * Tests that ensure each handler is registered only once.
+        */
+       @Test
+       public void testDuplicatedHandlerRegistration() throws Exception {
+               final TestJobSubmitHandler testJobSubmitHandler = new 
TestJobSubmitHandler();
+
+               assertThrows("Duplicate REST handler instance found. Please 
ensure each instance is registered only once.",
 
 Review comment:
   We generally try to avoid matching the exact text; it is quite tiresome 
having to adjust a test just because you changed added a bit more information.
   Since `assertThrows` only checks that the string is _contained_ in the 
exception we can instead use "Duplicate REST handler".

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to