Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15009#discussion_r106232474
  
    --- Diff: 
core/src/test/java/org/apache/spark/launcher/SparkLauncherSuite.java ---
    @@ -175,6 +175,37 @@ public void testChildProcLauncher() throws Exception {
           .setConf(SparkLauncher.DRIVER_EXTRA_CLASSPATH, 
System.getProperty("java.class.path"))
           .addSparkArg(opts.CLASS, "ShouldBeOverriddenBelow")
           .setMainClass(SparkLauncherTestApp.class.getName())
    +      .autoShutdown()
    +      .addAppArgs("proc");
    +    final Process app = launcher.launch();
    +
    +    new OutputRedirector(app.getInputStream(), TF);
    +    new OutputRedirector(app.getErrorStream(), TF);
    +    assertEquals(0, app.waitFor());
    +  }
    +
    +  @Test
    +  public void testThreadLauncher() throws Exception {
    +    // This test is failed on Windows due to the failure of initiating 
executors
    +    // by the path length limitation. See SPARK-18718.
    +    assumeTrue(!Utils.isWindows());
    +
    +    SparkSubmitOptionParser opts = new SparkSubmitOptionParser();
    +    Map<String, String> env = new HashMap<>();
    +    env.put("SPARK_PRINT_LAUNCH_COMMAND", "1");
    +
    +    launcher
    +      .setMaster("local")
    +      .setAppResource(SparkLauncher.NO_RESOURCE)
    +      .addSparkArg(opts.CONF,
    +        String.format("%s=-Dfoo=ShouldBeOverriddenBelow", 
SparkLauncher.DRIVER_EXTRA_JAVA_OPTIONS))
    +      .setConf(SparkLauncher.DRIVER_EXTRA_JAVA_OPTIONS,
    +        "-Dfoo=bar -Dtest.appender=childproc")
    +      .setConf(SparkLauncher.DRIVER_EXTRA_CLASSPATH, 
System.getProperty("java.class.path"))
    +      .addSparkArg(opts.CLASS, "ShouldBeOverriddenBelow")
    +      .setMainClass(SparkLauncherTestApp.class.getName())
    +      .launchAsThread(true)
    +      .autoShutdown()
    --- End diff --
    
    So you don't actually have a test for this feature here. This is not 
actually doing anything, because the launcher (which is the scalatest runner) 
won't die.
    
    You could use `disconnect()`, as you do in the YARN tests, to make sure 
this works.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to