How do I fix flaky tests in EXWS WorkspaceCleanupTest?

18 views
Skip to first unread message

martinda

unread,
Oct 24, 2019, 9:41:52 AM10/24/19
to Jenkins Developers
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

Jesse Glick

unread,
Oct 24, 2019, 12:04:18 PM10/24/19
to Jenkins Dev
On Thu, Oct 24, 2019 at 9:42 AM martinda <martin....@gmail.com> wrote:
> Below is an example of a flaky test.

But what is the flake?
Reply all
Reply to author
Forward
0 new messages