Re: How do I fix flaky tests in EXWS WorkspaceCleanupTest?

2019-10-24 Thread Jesse Glick
On Thu, Oct 24, 2019 at 9:42 AM martinda  wrote:
> Below is an example of a flaky test.

But what is the flake?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr09m-MSj%2Bp2Ae032-aJ5ZKJPUTVuU6oAzr7QhN%3DgSi3Jg%40mail.gmail.com.


How do I fix flaky tests in EXWS WorkspaceCleanupTest?

2019-10-24 Thread martinda
Hello,

I have flaky tests in the external workspace manager, I am not sure how to 
fix them since I use the latest parent pom (1.51), Jenkins 2.150.3 and its 
BOM.
I suspect it has to do with the JenkinsRule, but I am not sure how to debug 
that. Below is an example of a flaky test.

@Test
public void deleteWorkspace() throws Exception {
WorkflowRun run = createWorkflowJobAndRun(format("" +
"def extWorkspace = exwsAllocate diskPoolId: '%s' \n" +
"node ('linux') { \n" +
"   exws (extWorkspace) { \n" +
"   try { \n" +
"   writeFile file: 'foo.txt', text: 'bar' \n" +
"   } finally { \n" +
"   step ([$class: 'WsCleanup']) \n" +
"   } \n" +
"   } \n" +
"}", DISK_POOL_ID));
j.assertBuildStatusSuccess(run);
j.assertLogContains("[WS-CLEANUP] Deleting project 
workspace...[WS-CLEANUP] done", run);
assertThat(listFiles(tmp.getRoot(), nameFileFilter("foo.txt"), 
directoryFileFilter()), hasSize(0));
}

Any advice on how to fix the flakiness?

Thanks,
Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/56448720-59fa-4a3f-8c2d-9aa9d8ded5f4%40googlegroups.com.