Skip to content

Commit d24fabf

Browse files
committed
Stop running the unreliable known hosts test on ci.jenkins.io
Not valuable enough to deal with the disruption of unreliable tests. Tests are run regularly in my CI environment without issue and they are run by every developer that executes the tests. (cherry picked from commit c876c16)
1 parent d6b1bc3 commit d24fabf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsTestUtil.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,9 @@ public static String nonGitHubHost() {
153153

154154
/* Return true if known hosts tests should be run in this context */
155155
public static boolean runKnownHostsTests() {
156-
if (!JENKINS_URL.contains("ci.jenkins.io")) {
157-
/* Always run the tests if not on ci.jenkins.io */
158-
return true;
159-
}
160-
// Only test 10% of the time on ci.jenkins.io to reduce load on ssh providers
161-
return ThreadLocalRandom.current().nextInt(10) == 0;
156+
/* Run the problematic known hosts tests on all locations except ci.jenkins.io */
157+
/* Do not run the problematic known hosts tests on ci.jenkins.io, they are unreliable */
158+
return !JENKINS_URL.contains("ci.jenkins.io");
162159
}
163160

164161
/* Always return false, retained for test compatibility */

0 commit comments

Comments
 (0)