zhuzhurk commented on code in PR #20296:
URL: https://github.com/apache/flink/pull/20296#discussion_r931757494


##########
flink-runtime/src/main/java/org/apache/flink/runtime/messages/webmonitor/ClusterOverview.java:
##########
@@ -130,10 +150,16 @@ public String toString() {
         return "StatusOverview {"
                 + "numTaskManagersConnected="
                 + numTaskManagersConnected
+                + (numTaskManagersBlocked == 0
+                        ? ""
+                        : (", numSlotsBlocked=" + numTaskManagersBlocked))
                 + ", numSlotsTotal="
                 + numSlotsTotal
                 + ", numSlotsAvailable="
                 + numSlotsAvailable
+                + (numSlotsFreeAndBlocked == 0
+                        ? ""
+                        : (", numSlotsBlocked=" + numSlotsFreeAndBlocked))

Review Comment:
   numSlotsBlocked  -> numSlotsFreeAndBlocked



##########
flink-runtime/src/main/java/org/apache/flink/runtime/messages/webmonitor/ClusterOverview.java:
##########
@@ -130,10 +150,16 @@ public String toString() {
         return "StatusOverview {"
                 + "numTaskManagersConnected="
                 + numTaskManagersConnected
+                + (numTaskManagersBlocked == 0
+                        ? ""
+                        : (", numSlotsBlocked=" + numTaskManagersBlocked))

Review Comment:
   numSlotsBlocked -> numTaskManagersBlocked



##########
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java:
##########
@@ -159,19 +149,11 @@ public void testSerialization() throws IOException, 
ClassNotFoundException {
         verifySerializability(archivedGraph);
     }
 
-    @Test
-    public void testCreateFromInitializingJobForSuspendedJob() {
-        final ArchivedExecutionGraph suspendedExecutionGraph =
-                ArchivedExecutionGraph.createSparseArchivedExecutionGraph(
-                        new JobID(),
-                        "TestJob",
-                        JobStatus.SUSPENDED,
-                        new Exception("Test suspension exception"),
-                        null,
-                        System.currentTimeMillis());
-
-        assertThat(suspendedExecutionGraph.getState(), 
is(JobStatus.SUSPENDED));
-        assertThat(suspendedExecutionGraph.getFailureInfo(), notNullValue());
+    public static void assertContainsCheckpointSettings(ArchivedExecutionGraph 
archivedGraph) {

Review Comment:
   `Test` methods are not needed to be public in JUnit5.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java:
##########
@@ -42,43 +41,34 @@
 import org.apache.flink.runtime.scheduler.SchedulerTestingUtils;
 import org.apache.flink.runtime.taskmanager.TaskExecutionState;
 import org.apache.flink.testutils.TestingUtils;
-import org.apache.flink.testutils.executor.TestExecutorResource;
-import org.apache.flink.util.OptionalFailure;
-import org.apache.flink.util.SerializedValue;
+import org.apache.flink.testutils.executor.TestExecutorExtension;
 import org.apache.flink.util.TestLogger;
 
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.Function;
 
 import static java.util.Arrays.asList;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for the {@link ArchivedExecutionGraph}. */
 public class ArchivedExecutionGraphTest extends TestLogger {
 
-    @ClassRule
-    public static final TestExecutorResource<ScheduledExecutorService> 
EXECUTOR_RESOURCE =
-            TestingUtils.defaultExecutorResource();
+    @RegisterExtension
+    static final TestExecutorExtension<ScheduledExecutorService> 
EXECUTOR_RESOURCE =
+            TestingUtils.defaultExecutorExtension();
 
     private static ExecutionGraph runtimeGraph;
 
-    @BeforeClass
+    @BeforeAll
     public static void setupExecutionGraph() throws Exception {

Review Comment:
   `Before*`/`After*` methods are not needed to be public in JUnit5.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/messages/webmonitor/JobDetailsTest.java:
##########
@@ -79,7 +79,7 @@ public void testJobDetailsMarshalling() throws 
JsonProcessingException {
 
         final JobDetails unmarshalled = objectMapper.treeToValue(marshalled, 
JobDetails.class);
 
-        assertEquals(expected, unmarshalled);
+        assertThat(expected).isEqualTo(unmarshalled);

Review Comment:
   -> assertThat(unmarshalled).isEqualTo(expected);



##########
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java:
##########
@@ -159,19 +149,11 @@ public void testSerialization() throws IOException, 
ClassNotFoundException {
         verifySerializability(archivedGraph);
     }
 
-    @Test
-    public void testCreateFromInitializingJobForSuspendedJob() {

Review Comment:
   Moving around these methods makes hard to compare the diff of the changes.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraphTest.java:
##########
@@ -42,43 +41,34 @@
 import org.apache.flink.runtime.scheduler.SchedulerTestingUtils;
 import org.apache.flink.runtime.taskmanager.TaskExecutionState;
 import org.apache.flink.testutils.TestingUtils;
-import org.apache.flink.testutils.executor.TestExecutorResource;
-import org.apache.flink.util.OptionalFailure;
-import org.apache.flink.util.SerializedValue;
+import org.apache.flink.testutils.executor.TestExecutorExtension;
 import org.apache.flink.util.TestLogger;
 
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.function.Function;
 
 import static java.util.Arrays.asList;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for the {@link ArchivedExecutionGraph}. */
 public class ArchivedExecutionGraphTest extends TestLogger {

Review Comment:
   `public` is no longer needed for JUnit5 tests.
   `extends TestLogger` is no longer needed as well.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/messages/webmonitor/JobDetailsTest.java:
##########
@@ -101,6 +101,6 @@ public void testJobDetailsCompatibleUnmarshalling() throws 
IOException {
         final JobDetails unmarshalled =
                 objectMapper.readValue(COMPATIBLE_JOB_DETAILS, 
JobDetails.class);
 
-        assertEquals(expected, unmarshalled);
+        assertThat(expected).isEqualTo(unmarshalled);

Review Comment:
   -> assertThat(unmarshalled).isEqualTo(expected);



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to