rmetzger commented on a change in pull request #15998:
URL: https://github.com/apache/flink/pull/15998#discussion_r642458471



##########
File path: 
flink-tests/src/test/java/org/apache/flink/runtime/util/ExceptionUtilsITCase.java
##########
@@ -55,23 +55,25 @@
     @Test
     public void testIsDirectOutOfMemoryError() throws IOException, 
InterruptedException {
         String className = DummyDirectAllocatingProgram.class.getName();
-        String out = run(className, Collections.emptyList(), 
DIRECT_MEMORY_SIZE, -1);
-        assertThat(out, is(""));
+        RunResult result = run(className, Collections.emptyList(), 
DIRECT_MEMORY_SIZE, -1);
+        assertThat(result.getErrorOut() + result.getStandardOut(), is(""));
     }
 
     @Test
     public void testIsMetaspaceOutOfMemoryError() throws IOException, 
InterruptedException {
         String className = DummyClassLoadingProgram.class.getName();
         // load only one class and record required Metaspace
-        String normalOut =
+        RunResult normalOut =
                 run(className, getDummyClassLoadingProgramArgs(1), -1, 
INITIAL_BIG_METASPACE_SIZE);
-        long okMetaspace = Long.parseLong(normalOut);
+        long okMetaspace = Long.parseLong(normalOut.getStandardOut());
         // load more classes to cause 'OutOfMemoryError: Metaspace'
-        String oomOut = run(className, getDummyClassLoadingProgramArgs(1000), 
-1, okMetaspace);
-        assertThat(oomOut, is(""));
+        RunResult oomOut = run(className, 
getDummyClassLoadingProgramArgs(1000), -1, okMetaspace);
+        // 'OutOfMemoryError: Metaspace' errors are caught, hence no output 
means we produced the
+        // expected exception.
+        assertThat(oomOut.getErrorOut() + oomOut.getStandardOut(), is(""));

Review comment:
       I added a separator




-- 
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:
[email protected]


Reply via email to