提交 e7cdd651 编写于 作者: O Oleg Nenashev 提交者: GitHub

[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
上级 b7ec5342
......@@ -61,7 +61,8 @@ public class LauncherTest {
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.assertTrue;
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 class JNLPLauncherTest {
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 class JNLPLauncherTest {
// 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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册