Skip to content

Commit cae52d9

Browse files
committed
[DEBUG] FileParameterValueTest#fileParameter_canStillUse_internalHierarchy Test failure
The test `hudson.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy` failed in CI with error, <details><summary>failure log</summary> ``` java.lang.NullPointerException: Cannot invoke "org.htmlunit.html.DomElement.getHtmlElementDescendants()" because "doc" is null at org.htmlunit.html.HtmlPage.executeDeferredScriptsIfNeeded(HtmlPage.java:1466) at org.htmlunit.html.HtmlPage.initialize(HtmlPage.java:265) at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:701) at org.htmlunit.WebClient.loadWebResponseInto(WebClient.java:575) at org.htmlunit.WebClient.getPage(WebClient.java:493) at org.htmlunit.WebClient.getPage(WebClient.java:402) at org.htmlunit.WebClient.getPage(WebClient.java:538) at org.htmlunit.WebClient.getPage(WebClient.java:520) at org.jvnet.hudson.test.JenkinsRule$WebClient.getPage(JenkinsRule.java:2740) at org.jvnet.hudson.test.JenkinsRule.after(JenkinsRule.java:519) at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:677) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.lang.Thread.run(Thread.java:840) ``` </details> This is noticed in couple of PRs failing currently, * jenkinsci#10456 ([ref failed test result](https://ci.jenkins.io/job/Core/job/jenkins/job/PR-10456/7/testReport/)) * jenkinsci#10467 ([ref failed test result](https://ci.jenkins.io/job/Core/job/jenkins/job/PR-10467/2/testReport/)) I haven't been able to reproduce in local, but theory is these below mentioned delays could be the cause, * there is a slowness noticed in calls `wc.goTo(p.getUrl()...)` taking `~10s`. * And once the test is complete the stopping is taking another `10s`. <details><summary>log</summary> ``` [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running hudson.model.FileParameterValueTest === Starting fileParameter_canStillUse_internalHierarchy(hudson.model.FileParameterValueTest) 0.047 [id=21] INFO o.jvnet.hudson.test.WarExploder#explode: Using jenkins.war resources from /.../jenkins/war/target/jenkins 0.304 [id=21] INFO o.jvnet.hudson.test.JenkinsRule#createWebServer2: Running on http://localhost:64862/jenkins/ 0.367 [id=21] INFO jenkins.model.Jenkins#<init>: Starting version 2.504-SNAPSHOT 0.421 [id=36] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization 1.002 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/command-launcher.jpi as a dependency of gradle 1.012 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/apache-httpcomponents-client-4-api.jpi as a dependency of gradle 1.034 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/jdk-tool.jpi as a dependency of gradle 1.052 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/trilead-api.jpi as a dependency of gradle 1.079 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/eddsa-api.jpi as a dependency of gradle 1.084 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/gson-api.jpi as a dependency of gradle 1.098 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/mina-sshd-api-common.jpi as a dependency of gradle 1.109 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/mina-sshd-api-core.jpi as a dependency of gradle 1.134 [id=46] INFO hudson.PluginManager#considerDetachedPlugin: Loading a detached plugin /var/folders/80/w8mmdy513sb3y9fp5fr7vvqc0000gn/T/jenkins1642946911825735225/sshd.jpi as a dependency of gradle 1.353 [id=41] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins 1.362 [id=37] INFO j.b.api.BouncyCastlePlugin#start: /.../jenkins/test/target/j h15288515834251035408/plugins/bouncycastle-api/WEB-INF/optional-lib not found; for non RealJenkinsRule this is fine and can be ignored. 1.931 [id=53] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins 1.937 [id=34] INFO jenkins.InitReactorRunner$1#onAttained: Started all plugins 1.937 [id=47] INFO jenkins.InitReactorRunner$1#onAttained: Augmented all extensions 2.254 [id=53] INFO jenkins.InitReactorRunner$1#onAttained: System config loaded 2.255 [id=53] INFO jenkins.InitReactorRunner$1#onAttained: System config adapted 2.255 [id=37] INFO jenkins.InitReactorRunner$1#onAttained: Loaded all jobs 2.255 [id=37] INFO jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated 2.307 [id=50] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization 2.466 [test0 jenkinsci#1] Started by user SYSTEM 2.466 [test0 jenkinsci#1] Running as SYSTEM 2.466 [test0 jenkinsci#1] Building in workspace /.../jenkins/test/target/j h15288515834251035408/workspace/test0 2.466 [test0 jenkinsci#1] Copying file to direct-child1.txt 2.466 [test0 jenkinsci#1] Copying file to parent/child2.txt 2.899 [test0 jenkinsci#1] Finished: SUCCESS 3.046 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: getting ws 14.449 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got htmlunit for ws 14.450 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got ws 14.452 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: getting ws/parent 24.720 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got htmlunit for ws/parent 24.733 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: got ws/parent 24.733 [id=21] INFO h.model.FileParameterValueTest#fileParameter_canStillUse_internalHierarchy: completed 34.767 [id=21] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked. WARN: Please see http://www.slf4j.org/codes.html#release for an explanation. 34.799 [id=21] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped 34.840 [id=21] INFO o.j.h.t.TemporaryDirectoryAllocator#dispose: deleting /.../jenkins/test/target/j h15288515834251035408 [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 35.15 s -- in hudson.model.FileParameterValueTest ``` </details>
1 parent dddb459 commit cae52d9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/src/test/java/hudson/model/FileParameterValueTest.java

+16
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@
4040
import java.nio.file.Files;
4141
import java.util.Arrays;
4242
import java.util.List;
43+
import java.util.logging.Logger;
4344
import java.util.stream.Collectors;
4445
import org.htmlunit.Page;
4546
import org.htmlunit.html.HtmlPage;
4647
import org.htmlunit.util.NameValuePair;
4748
import org.junit.Assume;
49+
import org.junit.ClassRule;
4850
import org.junit.Rule;
4951
import org.junit.Test;
5052
import org.junit.rules.TemporaryFolder;
53+
import org.jvnet.hudson.test.BuildWatcher;
5154
import org.jvnet.hudson.test.Issue;
5255
import org.jvnet.hudson.test.JenkinsRule;
5356
import org.jvnet.hudson.test.recipes.LocalData;
@@ -59,6 +62,11 @@ public class FileParameterValueTest {
5962
@Rule
6063
public TemporaryFolder tmp = new TemporaryFolder();
6164

65+
@ClassRule
66+
public static BuildWatcher bw = new BuildWatcher();
67+
68+
public static final Logger LOGGER = Logger.getLogger(FileParameterValueTest.class.getName());
69+
6270
@Test
6371
@Issue("SECURITY-1074")
6472
public void fileParameter_cannotCreateFile_outsideOfBuildFolder() throws Exception {
@@ -318,15 +326,23 @@ public void fileParameter_canStillUse_internalHierarchy() throws Exception {
318326

319327
// and reachable using request
320328
JenkinsRule.WebClient wc = j.createWebClient();
329+
330+
LOGGER.info("getting ws");
321331
HtmlPage workspacePage = wc.goTo(p.getUrl() + "ws");
332+
LOGGER.info("got htmlunit for ws");
322333
String workspaceContent = workspacePage.getWebResponse().getContentAsString();
334+
LOGGER.info("got ws");
323335
assertThat(workspaceContent, allOf(
324336
containsString("direct-child1.txt"),
325337
containsString("parent")
326338
));
339+
LOGGER.info("getting ws/parent");
327340
HtmlPage workspaceParentPage = wc.goTo(p.getUrl() + "ws" + "/parent");
341+
LOGGER.info("got htmlunit for ws/parent");
328342
String workspaceParentContent = workspaceParentPage.getWebResponse().getContentAsString();
343+
LOGGER.info("got ws/parent");
329344
assertThat(workspaceParentContent, containsString("child2.txt"));
345+
LOGGER.info("completed");
330346
}
331347

332348
@Test

0 commit comments

Comments
 (0)