Skip to content

[core] fix cleanup logic for rolling file tests#90797

Merged
mshustov merged 5 commits intoelastic:masterfrom
mshustov:test-rolling-test-cleanup
Feb 11, 2021
Merged

[core] fix cleanup logic for rolling file tests#90797
mshustov merged 5 commits intoelastic:masterfrom
mshustov:test-rolling-test-cleanup

Conversation

@mshustov
Copy link
Copy Markdown
Contributor

@mshustov mshustov commented Feb 9, 2021

Summary

I noticed several rolling-testOe2nnT like folders after I ran integration_tests. It's turned out the cleanup stage failed silently due to

 [Error: ENOTEMPTY: directory not empty, rmdir 'rolling-testOe2nnT'] {
      errno: -66,
      code: 'ENOTEMPTY',
      syscall: 'rmdir',
      path: 'rolling-testOe2nnT'
    }

This PR fixes the problem and adds logging for the cases when fs.rmdir throws an exception.

@mshustov mshustov added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Feb 9, 2021
@mshustov mshustov requested a review from a team as a code owner February 9, 2021 15:50
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-core (Team:Core)

await rmdir(testDir);
await rmdir(testDir, { recursive: true });
} catch (e) {
/* trap */
Copy link
Copy Markdown
Contributor Author

@mshustov mshustov Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgayvallet Why we swallow an exception here?

@mshustov
Copy link
Copy Markdown
Contributor Author

mshustov commented Feb 9, 2021

@elasticmachine merge upstream

@mshustov mshustov enabled auto-merge (squash) February 11, 2021 09:39
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mshustov mshustov merged commit 35eef9c into elastic:master Feb 11, 2021
@mshustov mshustov added the auto-backport Deprecated - use backport:version if exact versions are needed label Feb 11, 2021
@mshustov mshustov deleted the test-rolling-test-cleanup branch February 11, 2021 11:26
@kibanamachine
Copy link
Copy Markdown
Contributor

Backport result

{"level":"info","message":"POST https://api.github.com/graphql (status: 200)"}
{"level":"info","message":"POST https://api.github.com/graphql (status: 200)"}
{"meta":{"labels":["Team:Core","auto-backport","release_note:skip","v7.12.0","v8.0.0"],"branchLabelMapping":{"^v8.0.0$":"master","^v7.12.0$":"7.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"},"existingTargetPullRequests":[]},"level":"info","message":"Inputs when calculating target branches:"}
{"meta":["7.x"],"level":"info","message":"Target branches inferred from labels:"}
{"meta":{"killed":false,"code":2,"signal":null,"cmd":"git remote rm kibanamachine","stdout":"","stderr":"error: No such remote: 'kibanamachine'\n"},"level":"info","message":"exec error 'git remote rm kibanamachine':"}
{"meta":{"killed":false,"code":2,"signal":null,"cmd":"git remote rm elastic","stdout":"","stderr":"error: No such remote: 'elastic'\n"},"level":"info","message":"exec error 'git remote rm elastic':"}
{"level":"info","message":"Backporting [{\"sourceBranch\":\"master\",\"targetBranchesFromLabels\":[\"7.x\"],\"sha\":\"35eef9c4d89b16ab87b19efb0fd3cdfd665d16ad\",\"formattedMessage\":\"[core] fix cleanup logic for rolling file tests (#90797)\",\"originalMessage\":\"[core] fix cleanup logic for rolling file tests (#90797)\\n\\n* fix cleanup for rolling file tests\\r\\n\\r\\n* do not swallow errors\\r\\n\\r\\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>\",\"pullNumber\":90797,\"existingTargetPullRequests\":[]}] to 7.x"}

Backporting to 7.x:
{"level":"info","message":"Backporting via filesystem"}
{"level":"info","message":"Creating PR with title: \"[7.x] [core] fix cleanup logic for rolling file tests (#90797)\". kibanamachine:backport/7.x/pr-90797 -> 7.x"}
{"level":"info","message":"POST /repos/elastic/kibana/pulls - 201 in 1050ms"}
{"level":"info","message":"Adding assignees to #91113: restrry"}
{"level":"info","message":"POST /repos/elastic/kibana/issues/91113/assignees - 201 in 521ms"}
{"level":"info","message":"Adding labels: backport"}
{"level":"info","message":"POST /repos/elastic/kibana/issues/91113/labels - 200 in 355ms"}
View pull request: https://github.com/elastic/kibana/pull/91113

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Feb 11, 2021
* fix cleanup for rolling file tests

* do not swallow errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
mshustov added a commit that referenced this pull request Feb 11, 2021
* fix cleanup for rolling file tests

* do not swallow errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Mikhail Shustov <restrry@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.12.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants