Skip to content
Permalink
Browse files

[JENKINS-39370] - Update Remoting in Jenkins core to 3.10 (#2886)

* Update Remoting in Jenkins core to 3.8

* JENKINS-39370 - Introduce support of Work Directories in remoting (opt-in).
* PR 129 - Allow configuring java.util.logging settings via a property file (-loggingConfig or JUL system property). See the Logging page for more details.
* JENKINS-37567 - Change of the code signing certificate

More info: https://github.com/jenkinsci/remoting/blob/master/CHANGELOG.md#38

* [JENKINS-39370] - Add direct tests for JNLP Launcher start with -workDir

* Pick Remoting 3.9

* Improve error message of LauncherTest#remoteKill()

* Update Remoting to 3.10
  • Loading branch information...
oleg-nenashev committed Jul 1, 2017
1 parent b7ec534 commit e7cdd6517cf25940a497f9abced72c888a398720
Showing with 34 additions and 3 deletions.
  1. +2 −1 core/src/test/java/hudson/LauncherTest.java
  2. +1 −1 pom.xml
  3. +31 −1 test/src/test/java/hudson/slaves/JNLPLauncherTest.java
@@ -61,7 +61,8 @@
p.kill();
assertTrue(p.join()!=0);
long end = System.currentTimeMillis();
assertTrue("join finished promptly", (end - start < 15000));
long terminationTime = end - start;
assertTrue("Join did not finish promptly. The completion time (" + terminationTime + "ms) is longer than expected 15s", terminationTime < 15000);
channels.french.call(NOOP); // this only returns after the other side of the channel has finished executing cancellation
Thread.sleep(2000); // more delay to make sure it's gone
assertNull("process should be gone",ProcessTree.get().get(Integer.parseInt(FileUtils.readFileToString(tmp).trim())));
@@ -168,7 +168,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId>
<version>3.7</version>
<version>3.10</version>
</dependency>

<dependency>
@@ -54,15 +54,20 @@
import static org.junit.Assert.fail;

import java.awt.*;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;

/**
* Tests of {@link JNLPLauncher}.
* @author Kohsuke Kawaguchi
*/
public class JNLPLauncherTest {
@Rule public JenkinsRule j = new JenkinsRule();

@Rule public TemporaryFolder tmpDir = new TemporaryFolder();

/**
* Starts a JNLP slave agent and makes sure it successfully connects to Hudson.
* Starts a JNLP agent and makes sure it successfully connects to Jenkins.
*/
@Test
public void testLaunch() throws Exception {
@@ -71,6 +76,20 @@ public void testLaunch() throws Exception {
Computer c = addTestSlave();
launchJnlpAndVerify(c, buildJnlpArgs(c));
}

/**
* Starts a JNLP agent and makes sure it successfully connects to Jenkins.
*/
@Test
@Issue("JENKINS-39370")
public void testLaunchWithWorkDir() throws Exception {
Assume.assumeFalse("Skipping JNLPLauncherTest.testLaunch because we are running headless", GraphicsEnvironment.isHeadless());
File workDir = tmpDir.newFolder("workDir");

Computer c = addTestSlave();
launchJnlpAndVerify(c, buildJnlpArgs(c).add("-workDir", workDir.getAbsolutePath()));
assertTrue("Remoting work dir should have been created", new File(workDir, "remoting").exists());
}

/**
* Tests the '-headless' option.
@@ -83,6 +102,17 @@ public void testHeadlessLaunch() throws Exception {
// make sure that onOffline gets called just the right number of times
assertEquals(1, ComputerListener.all().get(ListenerImpl.class).offlined);
}

@Test
@Issue("JENKINS-39370")
public void testHeadlessLaunchWithWorkDir() throws Exception {
Assume.assumeFalse("Skipping JNLPLauncherTest.testLaunch because we are running headless", GraphicsEnvironment.isHeadless());
File workDir = tmpDir.newFolder("workDir");

Computer c = addTestSlave();
launchJnlpAndVerify(c, buildJnlpArgs(c).add("-arg","-headless", "-workDir", workDir.getAbsolutePath()));
assertEquals(1, ComputerListener.all().get(ListenerImpl.class).offlined);
}

@TestExtension("testHeadlessLaunch")
public static class ListenerImpl extends ComputerListener {

0 comments on commit e7cdd65

Please sign in to comment.
You can’t perform that action at this time.