guoweiM commented on a change in pull request #10152: [FLINK-14466][runtime]
Let YarnJobClusterEntrypoint use user code class loader
URL: https://github.com/apache/flink/pull/10152#discussion_r346364508
##########
File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNITCase.java
##########
@@ -56,68 +62,94 @@
private final int sleepIntervalInMS = 100;
+ @Rule
+ public final TemporaryFolder temporaryFolder = new TemporaryFolder();
+
@BeforeClass
public static void setup() {
YARN_CONFIGURATION.set(YarnTestBase.TEST_CLUSTER_NAME_KEY,
"flink-yarn-tests-per-job");
startYARNWithConfig(YARN_CONFIGURATION);
}
@Test
- public void testPerJobMode() throws Exception {
- runTest(() -> {
- Configuration configuration = new Configuration();
- configuration.setString(AkkaOptions.ASK_TIMEOUT, "30
s");
- final YarnClient yarnClient = getYarnClient();
+ public void testPerJobModeWithEnableSystemClassPathIncludeUserJar()
throws Exception {
+ runTest(() ->
deployPerjob(YarnConfigOptions.UserJarInclusion.FIRST, false));
+ }
- try (final YarnClusterDescriptor yarnClusterDescriptor
= org.apache.flink.yarn.YarnTestUtils.createClusterDescriptorWithLogging(
-
System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR),
- configuration,
- getYarnConfiguration(),
- yarnClient,
- true)) {
+ @Test
+ public void testPerJobModeWithDisableSystemClassPathIncludeUserJar()
throws Exception {
+ runTest(() ->
deployPerjob(YarnConfigOptions.UserJarInclusion.DISABLED, false));
+ }
- yarnClusterDescriptor.setLocalJarPath(new
Path(flinkUberjar.getAbsolutePath()));
-
yarnClusterDescriptor.addShipFiles(Arrays.asList(flinkLibFolder.listFiles()));
-
yarnClusterDescriptor.addShipFiles(Arrays.asList(flinkShadedHadoopDir.listFiles()));
+ @Test
+ public void
testPerJobModeWithDisableSystemClassPathIncludeUserJarAndWithIllegalShipDirectoryName()
{
Review comment:
ok. But `YarnJobClusterEntrypointTest` does not test this situation.
I would propose to add the `checkArgument` to the
`YarnClusterDescriptor#addShipFiles` because this makes the test easier.
I would add a test case to `YarnClusterDescriptorTest` for this
`checkArgument`.
----------------------------------------------------------------
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