Myasuka commented on a change in pull request #18912:
URL: https://github.com/apache/flink/pull/18912#discussion_r816759546
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopWithSavepointTest.java
##########
@@ -133,6 +134,31 @@ public void testStopWithExplicitSavepointType() throws
Exception {
assertThat(jobID, is(jid));
assertThat(advanceToEndOfEventTime, is(false));
assertThat(savepointDirectory, is("test-target-dir"));
+ assertThat(formatType, is(expectedFormat));
+ stopWithSavepointLatch.trigger();
+ return
CompletableFuture.completedFuture(savepointDirectory);
+ });
+ MockedCliFrontend testFrontend = new MockedCliFrontend(clusterClient);
+ testFrontend.stop(parameters);
+ stopWithSavepointLatch.await();
+ }
+
+ @Test
+ public void testStopWithExplicitSavepointTypeLongOption() throws Exception
{
Review comment:
This is also true for these two test mthods, we can certainly avoid code
duplication via introducing a base private test method with a parameter of
option key.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
##########
@@ -200,7 +196,40 @@ public void testTriggerSavepointCustomFormat() throws
Exception {
MockedCliFrontend frontend = new MockedCliFrontend(clusterClient);
String[] parameters = {
- jobId.toString(), savepointDirectory, "-type",
SavepointFormatType.NATIVE.toString()
+ jobId.toString(), savepointDirectory, "-t",
SavepointFormatType.NATIVE.toString()
+ };
+ frontend.savepoint(parameters);
+
+ verify(clusterClient, times(1))
+ .triggerSavepoint(
+ eq(jobId), eq(savepointDirectory),
eq(SavepointFormatType.NATIVE));
+
+ assertTrue(buffer.toString().contains(savepointDirectory));
+ } finally {
+ clusterClient.close();
+
+ restoreStdOutAndStdErr();
+ }
+ }
+
+ @Test
+ public void testTriggerSavepointCustomFormatLongOption() throws Exception {
Review comment:
I think the only difference of these two test methods is the option, one
is `-t` and another is `--type`. We could use one base private method which
contains the main body and two test case with different option key to reduce
code duplication.
--
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]