Skip to content

Commit 0408c70

Browse files
authored
Wait before exiting testWidgets (#174)
* Wait a few seconds for test cleanup on Windows testWidgets The testWidgets() test fails consistently on ci.jenkins.io since the transition from Azure to AWS. Since the tests are already using long sleep calls for various other purposes, let's sleep at the exit from the failing test so that there is time for Java to close files. Testing done Confirmed that `mvn clean verify` passes on my Linux computer. Rely on ci.jenkins.io to confirm the fix works on Windows. * Try a 5 second sleep The 3 second sleep was enough in 3 of 4 test runs. Let's see if a 5 second sleep improves the failure rate.
1 parent d213889 commit 0408c70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/java/org/jenkinsci/plugins/matrixauth/Security2180Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import static org.junit.Assert.assertTrue;
99

1010
import com.cloudbees.hudson.plugins.folder.Folder;
11+
import hudson.Functions;
1112
import hudson.model.Cause;
1213
import hudson.model.Executor;
1314
import hudson.model.FreeStyleBuild;
@@ -292,6 +293,10 @@ public void testWidgets() throws Exception {
292293
final HtmlPage htmlPage = webClient.goTo("");
293294
final String contentAsString = htmlPage.getWebResponse().getContentAsString();
294295
assertThat(contentAsString, not(containsString("job/folder/job/job"))); // Fails while unfixed
296+
if (Functions.isWindows()) {
297+
// Wait several seconds so that files are closed before test cleanup
298+
Thread.sleep(5000);
299+
}
295300
}
296301

297302
@Test

0 commit comments

Comments
 (0)