diff --git a/core/src/main/java/jenkins/ErrorAttributeFilter.java b/core/src/main/java/jenkins/ErrorAttributeFilter.java index 9163e409f61d..be67bdab7588 100644 --- a/core/src/main/java/jenkins/ErrorAttributeFilter.java +++ b/core/src/main/java/jenkins/ErrorAttributeFilter.java @@ -3,6 +3,7 @@ import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -27,4 +28,14 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo servletRequest.setAttribute(USER_ATTRIBUTE, authentication); filterChain.doFilter(servletRequest, servletResponse); } + + @Override + public void destroy() { + // Otherwise the PCT fails + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + // Otherwise the PCT fails + } } diff --git a/test/pom.xml b/test/pom.xml index 5faa39fff2b0..75035b367d83 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -101,7 +101,7 @@ THE SOFTWARE. org.jenkins-ci.plugins script-security - 1271.vdede89739a_81 + 1273.v66c1964f0dfd diff --git a/test/src/test/java/hudson/model/CauseTest.java b/test/src/test/java/hudson/model/CauseTest.java index 4f4fba4e8121..0d4caf54f61b 100644 --- a/test/src/test/java/hudson/model/CauseTest.java +++ b/test/src/test/java/hudson/model/CauseTest.java @@ -61,10 +61,11 @@ public class CauseTest { @Test public void deeplyNestedCauses() throws Exception { FreeStyleProject a = j.createFreeStyleProject("a"); FreeStyleProject b = j.createFreeStyleProject("b"); - Run early = null; - Run last = null; + FreeStyleBuild early = null; + FreeStyleBuild last = null; + List> futures = new ArrayList<>(); for (int i = 1; i <= 15; i++) { - last = b.scheduleBuild2(0, new Cause.UpstreamCause((Run) a.scheduleBuild2(0, last == null ? null : new Cause.UpstreamCause(last)).get())).get(); + last = recordFuture(b.scheduleBuild2(0, new Cause.UpstreamCause(recordFuture(a.scheduleBuild2(0, last == null ? null : new Cause.UpstreamCause(last)), futures).get())), futures).get(); if (i == 5) { early = last; } @@ -73,6 +74,9 @@ public class CauseTest { assertTrue("keeps full history:\n" + buildXml, buildXml.contains("1")); buildXml = new XmlFile(Run.XSTREAM, new File(last.getRootDir(), "build.xml")).asString(); assertFalse("too big:\n" + buildXml, buildXml.contains("1")); + for (QueueTaskFuture future : futures) { + j.assertBuildStatusSuccess(j.waitForCompletion(future.waitForStart())); + } } @Issue("JENKINS-15747") @@ -84,17 +88,14 @@ public class CauseTest { Run last = null; for (int i = 1; i <= 10; i++) { Cause cause = last == null ? null : new Cause.UpstreamCause(last); - QueueTaskFuture next1 = a.scheduleBuild2(0, cause); - futures.add(next1); - futures.add(a.scheduleBuild2(0, cause)); + QueueTaskFuture next1 = recordFuture(a.scheduleBuild2(0, cause), futures); + recordFuture(a.scheduleBuild2(0, cause), futures); cause = new Cause.UpstreamCause(next1.get()); - QueueTaskFuture next2 = b.scheduleBuild2(0, cause); - futures.add(next2); - futures.add(b.scheduleBuild2(0, cause)); + QueueTaskFuture next2 = recordFuture(b.scheduleBuild2(0, cause), futures); + recordFuture(b.scheduleBuild2(0, cause), futures); cause = new Cause.UpstreamCause(next2.get()); - QueueTaskFuture next3 = c.scheduleBuild2(0, cause); - futures.add(next3); - futures.add(c.scheduleBuild2(0, cause)); + QueueTaskFuture next3 = recordFuture(c.scheduleBuild2(0, cause), futures); + recordFuture(c.scheduleBuild2(0, cause), futures); last = next3.get(); } int count = new XmlFile(Run.XSTREAM, new File(last.getRootDir(), "build.xml")).asString().split(Pattern.quote(" recordFuture(QueueTaskFuture future, List> futures) { + futures.add(future); + return future; + } @Issue("JENKINS-48467") @Test public void userIdCausePrintTest() throws Exception { diff --git a/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java b/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java index a9c64db9756e..c9deee7aac73 100644 --- a/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java +++ b/test/src/test/java/hudson/model/queue/MaintainCanTakeStrengtheningTest.java @@ -4,13 +4,13 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; +import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.Label; import hudson.model.Node; import hudson.model.Queue; import hudson.slaves.DumbSlave; import hudson.slaves.NodeProperty; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import org.junit.Rule; import org.junit.Test; @@ -26,7 +26,7 @@ public class MaintainCanTakeStrengtheningTest { @Rule public LoggerRule logging = new LoggerRule().record(Node.class.getName(), Level.ALL).capture(100); - private QueueTaskFuture scheduleBuild(String name, String label) throws Exception { + private QueueTaskFuture scheduleBuild(String name, String label) throws Exception { FreeStyleProject project = r.createFreeStyleProject(name); project.setAssignedLabel(Label.get(label)); @@ -44,15 +44,9 @@ public void testExceptionOnNodeProperty() throws Exception { r.createOnlineSlave(Label.get("good")); // Only the good ones will be run and the latest doesn't get hung because of the second - QueueTaskFuture[] taskFuture = new QueueTaskFuture[3]; - taskFuture[0] = scheduleBuild("good1", "good"); - taskFuture[1] = scheduleBuild("theFaultyOne", "faulty"); - taskFuture[2] = scheduleBuild("good2", "good"); - - // Wait for a while until the good ones start, no need to wait for their completion to guarantee - // the fix works - taskFuture[0].getStartCondition().get(15, TimeUnit.SECONDS); - taskFuture[2].getStartCondition().get(15, TimeUnit.SECONDS); + FreeStyleBuild good1 = scheduleBuild("good1", "good").waitForStart(); + scheduleBuild("theFaultyOne", "faulty"); + FreeStyleBuild good2 = scheduleBuild("good2", "good").waitForStart(); // The faulty one is the only one in the queue assertThat(r.getInstance().getQueue().getBuildableItems().size(), equalTo(1)); @@ -60,6 +54,10 @@ public void testExceptionOnNodeProperty() throws Exception { // The new error is shown in the logs assertThat(logging.getMessages(), hasItem(String.format("Exception evaluating if the node '%s' can take the task '%s'", faultyAgent.getDisplayName(), "theFaultyOne"))); + + // Tear down + r.assertBuildStatusSuccess(r.waitForCompletion(good1)); + r.assertBuildStatusSuccess(r.waitForCompletion(good2)); } /** diff --git a/war/src/main/scss/abstracts/_theme.scss b/war/src/main/scss/abstracts/_theme.scss index abc5fd3cb928..2ea8f434481d 100644 --- a/war/src/main/scss/abstracts/_theme.scss +++ b/war/src/main/scss/abstracts/_theme.scss @@ -116,8 +116,8 @@ $semantics: ( // Deprecated - Button primary --button-color--primary: var(--background); --btn-primary-bg: #063f61; - --btn-primary-bg-hover: lighten(#063f61, 7.5%); - --btn-primary-bg-active: lighten(#063f61, 12%); + --btn-primary-bg-hover: #{lighten(#063f61, 7.5%)}; + --btn-primary-bg-active: #{lighten(#063f61, 12%)}; // Deprecated - Button primary --btn-secondary-color: var(--secondary); --btn-secondary-bg: var(--btn-text-color);