diff --git a/core/pom.xml b/core/pom.xml index bd7f2d0370c0d131048a72417e5fb5ad2c4c3a61..d2bdca549a30140857e826c6614dd598982323bc 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT ../pom.xml diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index ef377f444164ac9f0836811e06008fa629fcb46b..4557cc321bb2268ae59b6f9487ce487b80f37a3c 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -192,8 +192,6 @@ public final class WebAppMain implements ServletContextListener { throw new Error(e); } - Trigger.init(); // start running trigger - // trigger the loading of changelogs in the background, // but give the system 10 seconds so that the first page // can be served quickly diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index 7a3f06118229e0651d6132cb0c51f5feffbc1126..254a343c38fb88b969f79efab816449139b46dd6 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -557,6 +557,8 @@ public final class Hudson extends Node implements ItemGroup, Stapl t.printStackTrace(); } } + + Trigger.init(); // start running trigger } public TcpSlaveAgentListener getTcpSlaveAgentListener() { diff --git a/debian/changelog b/debian/changelog index 99681cd98f46a358b6c1adb97c24eab4934ab796..08eb9ff70c3f6c78f3c400733ccc304a20ff8206 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +hudson (1.293) unstable; urgency=low + + * See http://hudson.dev.java.net/changelog.html for more details. + + -- Kohsuke Kawaguchi Fri, 20 Mar 2009 19:11:14 -0700 + hudson (1.292) unstable; urgency=low * See http://hudson.dev.java.net/changelog.html for more details. diff --git a/maven-agent/pom.xml b/maven-agent/pom.xml index 5217afc10ce59f7121a338ca26b8150c50574196..2dabe6195d9d45332b4b4d90bbe0830f1afc5e79 100644 --- a/maven-agent/pom.xml +++ b/maven-agent/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT ../pom.xml diff --git a/maven-interceptor/pom.xml b/maven-interceptor/pom.xml index f4b17ce6cd3fab197fd4d8c63ca0192ba6f6c7cf..5d984e4bf960477952014f4b2967a38b9c58e18c 100644 --- a/maven-interceptor/pom.xml +++ b/maven-interceptor/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 5a3cf2164928b4f2f1ef7d4156347b0b87e92500..a2fab900a859c9f4941e23515e45502e0cd9aa97 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT pom Hudson main module diff --git a/remoting/pom.xml b/remoting/pom.xml index 40fc29d771b6e48120ba8855d8198d9966d7e0c7..89bfafabc649607936b8324df3ab3bcb08c56fa6 100644 --- a/remoting/pom.xml +++ b/remoting/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT ../pom.xml diff --git a/test/pom.xml b/test/pom.xml index ba8aa73c654f5f5285d32b8809f9bbc07a7fbe1e..69a22a7bc1cc953bb02b58c542bc3feb270f806f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. pom org.jvnet.hudson.main - 1.293-SNAPSHOT + 1.294-SNAPSHOT 4.0.0 org.jvnet.hudson.main diff --git a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java index a6f05b7e6cb6c7584442862009108463bcc2472d..0369d84735af61cb5ce2f1a71d042c7b64c6ec63 100644 --- a/test/src/test/java/hudson/slaves/NodeProvisionerTest.java +++ b/test/src/test/java/hudson/slaves/NodeProvisionerTest.java @@ -24,12 +24,9 @@ package hudson.slaves; import hudson.BulkChange; -import hudson.model.FreeStyleBuild; -import hudson.model.FreeStyleProject; -import hudson.model.LoadStatistics; -import hudson.model.Node; -import hudson.model.Result; -import hudson.model.Label; +import hudson.Launcher; +import hudson.model.*; +import hudson.tasks.Builder; import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.SleepBuilder; @@ -37,9 +34,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; /** * @author Kohsuke Kawaguchi @@ -60,6 +57,38 @@ public class NodeProvisionerTest extends HudsonTestCase { LoadStatistics.CLOCK = original; } + /** + * Latch synchronization primitive that waits for N thread to pass the checkpoint. + *

+ * This is used to make sure we get a set of builds that run long enough. + */ + static class Latch { + /** Initial value */ + public final int init; + private int n; + + Latch(int n) { + this.n = init = n; + } + + synchronized void block() throws InterruptedException { + if(--n==0) notifyAll(); // wake up everyone else + else wait(60*1000); // if a test takes t oo long, abort. + } + + /** + * Creates a builder that blocks until the latch opens. + */ + public Builder createBuilder() { + return new Builder() { + public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { + block(); + return true; + } + }; + } + } + /** * Scenario: schedule a build and see if one slave is provisioned. */ @@ -69,7 +98,7 @@ public class NodeProvisionerTest extends HudsonTestCase { DummyCloudImpl cloud = initHudson(10); - FreeStyleProject p = createJob(10); + FreeStyleProject p = createJob(new SleepBuilder(10)); Future f = p.scheduleBuild2(0); f.get(30, TimeUnit.SECONDS); // if it's taking too long, abort. @@ -89,7 +118,7 @@ public class NodeProvisionerTest extends HudsonTestCase { try { DummyCloudImpl cloud = initHudson(0); - verifySuccessfulCompletion(buildAll(create5SlowJobs())); + verifySuccessfulCompletion(buildAll(create5SlowJobs(new Latch(5)))); // the time it takes to complete a job is eternally long compared to the time it takes to launch // a new slave, so in this scenario we end up allocating 5 slaves for 5 jobs. @@ -110,7 +139,7 @@ public class NodeProvisionerTest extends HudsonTestCase { createSlave().toComputer().connect(false).get(); createSlave().toComputer().connect(false).get(); - verifySuccessfulCompletion(buildAll(create5SlowJobs())); + verifySuccessfulCompletion(buildAll(create5SlowJobs(new Latch(5)))); // we should have used two static slaves, thus only 3 slaves should have been provisioned assertEquals(3,cloud.numProvisioned); @@ -131,12 +160,12 @@ public class NodeProvisionerTest extends HudsonTestCase { cloud.label = red; // red jobs - List redJobs = create5SlowJobs(); + List redJobs = create5SlowJobs(new Latch(5)); for (FreeStyleProject p : redJobs) p.setAssignedLabel(red); // blue jobs - List blueJobs = create5SlowJobs(); + List blueJobs = create5SlowJobs(new Latch(5)); for (FreeStyleProject p : blueJobs) p.setAssignedLabel(blue); @@ -156,10 +185,10 @@ public class NodeProvisionerTest extends HudsonTestCase { } - private FreeStyleProject createJob(int delay) throws IOException { + private FreeStyleProject createJob(Builder builder) throws IOException { FreeStyleProject p = createFreeStyleProject(); p.setAssignedLabel(null); // let it roam free, or else it ties itself to the master since we have no slaves - p.getBuildersList().add(new SleepBuilder(delay)); + p.getBuildersList().add(builder); return p; } @@ -174,12 +203,12 @@ public class NodeProvisionerTest extends HudsonTestCase { return cloud; } - private List create5SlowJobs() throws IOException { + private List create5SlowJobs(Latch l) throws IOException { List jobs = new ArrayList(); - for( int i=0; i<5; i++) + for( int i=0; i> builds) throws Exception { System.out.println("Waiting for a completion"); for (Future f : builds) { - FreeStyleBuild b = f.get();// if it's taking too long, abort. - assertBuildStatus(Result.SUCCESS,b); + try { + assertBuildStatus(Result.SUCCESS, f.get(1, TimeUnit.MINUTES)); + } catch (TimeoutException e) { + // time out so that the automated test won't hang forever, even when we have bugs + System.out.println("Build didn't complete in time"); + throw e; + } } } } diff --git a/war/pom.xml b/war/pom.xml index 74fd95ae5f45220207844849758004e2e68f6f86..d686eb2acc8c99340ab92e33ed3c63cba75d5247 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -27,7 +27,7 @@ THE SOFTWARE. org.jvnet.hudson.main pom - 1.293-SNAPSHOT + 1.294-SNAPSHOT ../pom.xml