Skip to content

Test regressions after JTH bump - #9762

Merged
basil merged 3 commits into
jenkinsci:masterfrom
jglick:java.io.tmpdir
Sep 20, 2024
Merged

Test regressions after JTH bump#9762
basil merged 3 commits into
jenkinsci:masterfrom
jglick:java.io.tmpdir

Conversation

@jglick

@jglick jglick commented Sep 19, 2024

Copy link
Copy Markdown
Member

Supersedes #9759. Downstream of jenkinsci/jenkins-test-harness#842.

FreeStyleBuild b = r.buildAndAssertSuccess(p);
if (webSocket) {
assertThat(agent.toComputer().getSystemProperties().get("java.class.path"), is(new File(r.jenkins.root, "agent.jar").getAbsolutePath()));
assertThat(agent.toComputer().getSystemProperties().get("java.class.path").toString(), endsWith("agent.jar"));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assertion introduced in #6780, if I recall correctly just to somehow use the Channel, and made more brittle in #7192. Does not need to check the exact path, or even really this property, it is just exercising Remoting.

if (expectedRemotingVersion != null) {
FileUtils.copyURLToFile(Security3430Test.class.getResource(remotingResourcePath), new File(jj.getHome(), "agent.jar"));
// TODO brittle; rather call InboundAgentRule.start(AgentArguments, Options) with a known agentJar
FileUtils.copyURLToFile(Security3430Test.class.getResource(remotingResourcePath), new File(System.getProperty("java.io.tmpdir"), "agent.jar"));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in 5d26b53. jenkinsci/jenkins-test-harness#838 picks a different location.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jenkinsci/jenkins-test-harness#843 fixes location reuse that likely caused the failure being @Ignored here.

assertThat(logRecords, hasItem(logMessageContainsString("Allowing URL: file:/")));
} else {
assertThat(logRecords, is(empty()));
assertThat(logRecords.stream().map(LogRecord::getMessage).toList(), is(empty()));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous failure message was unhelpful (LogRecord does not override toString).

Comment thread test/src/test/java/jenkins/security/Security3430Test.java
@jglick
jglick marked this pull request as ready for review September 20, 2024 12:06

@basil basil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@basil
basil merged commit ae2e780 into jenkinsci:master Sep 20, 2024
@jglick
jglick deleted the java.io.tmpdir branch September 20, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants