Skip to content
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

Fix tests for IPV6 #362

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
</pluginRepositories>
<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.387.3</jenkins.version>
<!-- TODO until in plugin-pom -->
<jenkins-test-harness.version>2042.v787a_641a_9b_26</jenkins-test-harness.version>
<!-- TODO Until in plugin-pom -->
Copy link
Member

Choose a reason for hiding this comment

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

jenkinsci/plugin-pom#908 needs release apparently. Maybe we should switch to CD.

<jenkins-test-harness.version>2182.v0138ccb_c0b_cb_</jenkins-test-harness.version>
<jenkins.version>2.440.1</jenkins.version>
<useBeta>true</useBeta>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<hpi.compatibleSinceVersion>2.40</hpi.compatibleSinceVersion>
Expand All @@ -77,8 +77,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.387.x</artifactId>
<version>2378.v3e03930028f2</version>
<artifactId>bom-2.440.x</artifactId>
<version>2907.vcb_35d6f2f7de</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ private static void scriptExitingAcrossRestart1(JenkinsRule r) throws Throwable
var p = r.createProject(WorkflowJob.class, "p");
var f = new File(r.jenkins.getRootDir(), "f");
p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("F")));
p.setDefinition(new CpsFlowDefinition("node('remote') {if (isUnix()) {sh 'sleep 5 && touch \"$F\"'} else {bat 'ping -n 5 localhost && copy nul \"%F%\" && dir \"%F%\"'}}", true));
p.setDefinition(new CpsFlowDefinition("node('remote') {if (isUnix()) {sh 'sleep 5 && touch \"$F\"'} else {bat 'ping -n 5 " + r.getURL().getHost() + " && copy nul \"%F%\" && dir \"%F%\"'}}", true));
Copy link
Member

Choose a reason for hiding this comment

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

I guess; did you test this on Windows with IPv6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, as I only had access to linux machines with IPv6 so I made sure it will not break any existing pr builder which uses ipv4 on windows and in case it breaks on windows with ipv6 for some reason we can fix later.

var b = p.scheduleBuild2(0, new ParametersAction(new StringParameterValue("F", f.getAbsolutePath()))).waitForStart();
r.waitForMessage(Functions.isWindows() ? ">ping -n 5 localhost" : "+ sleep 5", b);
r.waitForMessage(Functions.isWindows() ? ">ping -n 5 " + r.getURL().getHost() : "+ sleep 5", b);
r.jenkins.doQuietDown(true, 0, null);
}

Expand Down