wangyang0918 commented on code in PR #19772:
URL: https://github.com/apache/flink/pull/19772#discussion_r889806375
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendDynamicPropertiesTest.java:
##########
@@ -182,4 +196,45 @@ protected void executeProgram(Configuration configuration,
PackagedProgram progr
program.getUserCodeClassLoader().getClass().getName());
}
}
+
+ public static void verifyCliFrontendWithDynamicProperties(
+ Configuration configuration,
+ String[] parameters,
+ GenericCLI cliUnderTest,
+ Duration expectedClientTimeout,
+ int expectedDefaultParallelism)
+ throws Exception {
+ TestingCliFrontendWithDynamicProperties testFrontend =
+ new TestingCliFrontendWithDynamicProperties(
+ configuration,
+ cliUnderTest,
+ expectedClientTimeout,
+ expectedDefaultParallelism);
+ testFrontend.run(parameters); // verifies the expected values (see
below)
+ }
+
+ private static final class TestingCliFrontendWithDynamicProperties extends
CliFrontend {
Review Comment:
I would like to have a more general testing class. Something like following.
```
private static final class TestingCliFrontendWithDynamicProperties
extends CliFrontend {
private final Map<String, String> expectedConfigValues;
... ...
@Override
protected void executeProgram(Configuration configuration,
PackagedProgram program) {
expectedConfigValues.forEach(
(key, value) -> assertEquals(value,
configuration.toMap().get(key)));
}
}
```
##########
flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java:
##########
@@ -424,10 +417,11 @@ protected void list(String[] args) throws Exception {
}
final CustomCommandLine activeCommandLine =
validateAndGetActiveCommandLine(commandLine);
+ Configuration effectiveConfiguration =
Review Comment:
Instead of get the effective configuration every time, could we simply add a
new args for `runAction`?
```
void runAction(ClusterClient<ClusterID> clusterClient, Configuration
effectiveConfiguration)
```
--
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]