tillrohrmann commented on a change in pull request #10532:
[FLINK-15053][runtime] Escape all dynamical property values for taskmanager
URL: https://github.com/apache/flink/pull/10532#discussion_r360342653
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/BootstrapToolsTest.java
##########
@@ -412,15 +414,20 @@ public void
testActorSystemInstantiationFailureWhenPortOccupied() throws Excepti
@Test
public void testGetDynamicProperties() {
- Configuration baseConfig = new Configuration();
+ final Configuration baseConfig = new Configuration();
baseConfig.setString("key.a", "a");
baseConfig.setString("key.b", "b1");
- Configuration targetConfig = new Configuration();
+ final String valueB = "#a,b&c^d*e%f(g!h";
+ final Configuration targetConfig = new Configuration();
targetConfig.setString("key.b", "b2");
- targetConfig.setString("key.c", "c");
-
- String dynamicProperties =
BootstrapTools.getDynamicProperties(baseConfig, targetConfig);
- assertEquals("-Dkey.b=b2 -Dkey.c=c", dynamicProperties);
+ targetConfig.setString("key.c", valueB);
+ targetConfig.setString("key.d", "my'value is 1");
+
+ final String[] dynamicProperties =
BootstrapTools.getDynamicProperties(baseConfig, targetConfig);
+ assertThat(Arrays.asList(dynamicProperties),
Matchers.containsInAnyOrder(
+ "-Dkey.b='b2'",
+ "-Dkey.c='" + valueB + "'",
+ "-Dkey.d='my'\\''value is 1'"));
Review comment:
I think we are overloading this test a bit. Instead of testing the dynamic
properties string generation it now tests the encoding. I would suggest to test
the encoding separately.
----------------------------------------------------------------
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]
With regards,
Apache Git Services