Skip to content

Commit 47464c3

Browse files
committed
adjust flaky test
Do not explicitly test the output. In rare cases job 2 starts before job 1, then the outputs are wrong. In any case the builds succeed which they didn't before the fix
1 parent f459e51 commit 47464c3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/test/java/org/jenkinsci/plugins/workflow/libs/LibraryAdderTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ public void correctLibraryDirectoryUsedWhenResumingOldBuild() throws Exception {
480480
public void parallelBuildsDontInterfereWithExpiredCache() throws Throwable {
481481
// Add a few files to the library so the deletion is not too fast
482482
// Before fixing JENKINS-66898 this test was failing almost always
483+
// with a build failure
483484
sampleRepo.init();
484485
sampleRepo.write("vars/foo.groovy", "def call() { echo 'foo' }");
485486
sampleRepo.write("vars/bar.groovy", "def call() { echo 'bar' }");
@@ -507,10 +508,12 @@ public void parallelBuildsDontInterfereWithExpiredCache() throws Throwable {
507508
cache.touch(oldMillis);
508509
QueueTaskFuture<WorkflowRun> f1 = p1.scheduleBuild2(0);
509510
QueueTaskFuture<WorkflowRun> f2 = p2.scheduleBuild2(0);
510-
WorkflowRun r1 = r.assertBuildStatus(Result.SUCCESS, f1);
511-
WorkflowRun r2 = r.assertBuildStatus(Result.SUCCESS, f2);
512-
r.assertLogContains("is due for a refresh after", r1);
513-
r.assertLogContains("Library library@master is cached. Copying from home.", r2);
511+
r.assertBuildStatus(Result.SUCCESS, f1);
512+
r.assertBuildStatus(Result.SUCCESS, f2);
513+
// Disabling these 2 checks as they are flaky
514+
// Occasionally the second job runs first and then build output doesn't match
515+
// r.assertLogContains("is due for a refresh after", f1.get());
516+
// r.assertLogContains("Library library@master is cached. Copying from home.", f2.get());
514517
}
515518

516519
@Issue("JENKINS-68544")

0 commit comments

Comments
 (0)