-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tests/e2e): ensure spawned cmds are closed #18664
Conversation
Signed-off-by: Thomas Gosteli <thomas.gosteli@protonmail.ch>
Hi @ghouscht. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted filessee 25 files with indirect coverage changes @@ Coverage Diff @@
## main #18664 +/- ##
==========================================
+ Coverage 68.77% 68.80% +0.02%
==========================================
Files 420 420
Lines 35535 35535
==========================================
+ Hits 24440 24449 +9
- Misses 9660 9662 +2
+ Partials 1435 1424 -11 Continue to review full report in Codecov by Sentry.
|
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you @ghouscht
@ghouscht could you please also backport the fix to 3.5 and 3.4 if needed? |
Quick (and maybe naive) question. As I was checking if we needed to backport, I realized that the test doesn't exist for the
Do we need to close the command in those instances, too? Or is it only relevant to this test because we're creating a snapshot? |
It seems to not matter for the other tests in this file. Most likely because they seem to test certain flag values that aren't supported so nothing is written to the filesystem. But as a rule of thumb I'd say whenever |
In that case, etcdserver will panic and exit automatically. But It will not do any harm to call |
Thanks for the explanation. I wasn't sure if that was required. I'm fine whether we address it in a follow-up or not (as it shouldn't cause an issue). As for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks so much for your work toward addressing flaky tests, Thomas.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, ghouscht, ivanvc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This should fix #18412.
After the test case is done Go's testing pkg tries to cleanup the temporary directories that were created by calls to
TempDir()
. This cleanup sometimes failed with errors like:I belive the cleanup sometimes happened before the etcd process was stopped which lead to the above error. Adding the defer statement to make sure the process is done before the test case returns seems to fix the error for me.
Before my changes I was able to reliably reproduce the issue with
and with the changes from this PR I'm no longer able to reproduce this.