提交 542ab897 编写于 作者: K kohsuke

fixed a race condition in a test.

mindless discovered that m.scheduleBuild2(0).get(0) has a cascading effect on module builds, which can cause later m.getModule(...).scheduleBuild2(0) to return null, as it may be already in the queue.

I initially wanted to fix this by making Queue.schedule() returns the existing item if it's already in the queue, but this turns out to be inpractical given that the signature is WaitingItem and not Item.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22991 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b1b384d2
......@@ -81,9 +81,11 @@ public class MavenBuildTest extends HudsonTestCase {
SubversionSCM scm = new SubversionSCM("https://www.dev.java.net/svn/hudson/trunk/hudson/test-projects/multimodule-maven");
setJavaNetCredential(scm);
m.setScm(scm);
m.setAggregatorStyleBuild(false);
assertBuildStatusSuccess(m.scheduleBuild2(0).get());
m.setAggregatorStyleBuild(false);
// run module builds
assertBuildStatusSuccess(m.getModule("test$module1").scheduleBuild2(0).get());
assertBuildStatusSuccess(m.getModule("test$module1").scheduleBuild2(0).get());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册