-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test regressions after JTH bump #9762
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
import org.hamcrest.Description; | ||
import org.hamcrest.Matcher; | ||
import org.hamcrest.TypeSafeMatcher; | ||
import org.junit.Ignore; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.InboundAgentRule; | ||
|
@@ -63,14 +64,16 @@ public void runWithPreviousAgentJar() throws Throwable { | |
runWithRemoting("3256.v88a_f6e922152", "/old-remoting/remoting-before-SECURITY-3430-fix.jar", true); | ||
} | ||
|
||
@Ignore("TODO Expected: is an empty collection; but: <[Allowing URL: file:/…/test/target/webroot…/WEB-INF/lib/stapler-1903.v994a_db_314d58.jar, Determined to be core jar: file:/…/test/target/webroot…/WEB-INF/lib/stapler-1903.v994a_db_314d58.jar]>") | ||
daniel-beck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Test | ||
public void runWithCurrentAgentJar() throws Throwable { | ||
runWithRemoting(null, null, false); | ||
} | ||
|
||
private void runWithRemoting(String expectedRemotingVersion, String remotingResourcePath, boolean requestingJarFromAgent) throws Throwable { | ||
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")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Introduced in 5d26b53. jenkinsci/jenkins-test-harness#838 picks a different location. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
} | ||
|
||
jj.startJenkins(); | ||
|
@@ -126,7 +129,7 @@ private static void _run(JenkinsRule j, String agentName, String expectedRemotin | |
if (requestingJarFromAgent) { | ||
assertThat(logRecords, hasItem(logMessageContainsString("Allowing URL: file:/"))); | ||
} else { | ||
assertThat(logRecords, is(empty())); | ||
assertThat(logRecords.stream().map(LogRecord::getMessage).toList(), is(empty())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous failure message was unhelpful ( |
||
} | ||
|
||
logHandler.clear(); | ||
|
@@ -140,7 +143,7 @@ private static void _run(JenkinsRule j, String agentName, String expectedRemotin | |
assertThat(ex.getMessage(), containsString("No hudson.remoting.JarURLValidator has been set for this channel, so all #fetchJar calls are rejected. This is likely a bug in Jenkins. As a workaround, try updating the agent.jar file.")); | ||
} else { | ||
assertTrue(channel.preloadJar(j.jenkins.getPluginManager().uberClassLoader, Stapler.class)); | ||
assertThat(logRecords, is(empty())); | ||
assertThat(logRecords.stream().map(LogRecord::getMessage).toList(), is(empty())); | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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.