-
Notifications
You must be signed in to change notification settings - Fork 3.8k
test: remove /dev/loopX in TestRwLoop #9308
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
Conversation
|
Hi @ZhangShuaiyi. Thanks for your PR. I'm waiting for a containerd 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. DetailsInstructions 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/test-infra repository. |
|
This looks like a good cleanup; can you please sign your commit according to our guidance here: https://github.com/containerd/project/blob/main/CONTRIBUTING.md#sign-your-work |
austinvazquez
left a comment
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.
Nice find. For project checks, you would need to add a DCO. See https://github.com/containerd/project/blob/main/CONTRIBUTING.md#sign-your-work for help on this.
mount/losetup_linux_test.go
Outdated
| defer func() { | ||
| dev := file.Name() | ||
| file.Close() | ||
| if err := removeLoop(dev); err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| }() |
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.
Alternatively, for conciseness should the solution be to just use Autoclear: true similar toTestRoLoop?
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.
@austinvazquez How about using Autoclear: ture in TestRwLoop, and add a new test case for Autoclear: false?
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.
+1, yeah it was not clear before that TestRwLoop was intended to test Autoclear: false. The tests you have added are much more intentional. Thanks.
|
@estesp Thanks, I will add a DCO later |
a3a25cb to
f111733
Compare
|
/ok-to-test |
|
@henry118: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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/test-infra repository. |
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.
Run 10 times TestAutoclearTrueLoop in a 1C4G vm. TestAutoclearTrueLoop not always pass.
root@ubuntu2004:~/containerd# uname -a
Linux ubuntu2004 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu2004:~/containerd# nproc
1
root@ubuntu2004:~/containerd# go test -count 10 github.com/containerd/containerd/mount -test.root -run TestAutoclearTrueLoop
--- FAIL: TestAutoclearTrueLoop (0.01s)
losetup_linux_test.go:136: removeLoop should fail if Autoclear is true
--- FAIL: TestAutoclearTrueLoop (0.03s)
losetup_linux_test.go:136: removeLoop should fail if Autoclear is true
--- FAIL: TestAutoclearTrueLoop (0.01s)
losetup_linux_test.go:136: removeLoop should fail if Autoclear is true
--- FAIL: TestAutoclearTrueLoop (0.02s)
losetup_linux_test.go:136: removeLoop should fail if Autoclear is true
FAIL
FAIL github.com/containerd/containerd/mount 0.254s
FAIL
|
Loop deivce's autoclear is asynchronous. __loop_clr_fd was called in |
21a4d44 to
c4a447b
Compare
|
@ZhangShuaiyi mind squashing your commits? the changes lgtm |
Signed-off-by: Shuaiyi Zhang <[email protected]>
c4a447b to
b6adf43
Compare
|
@henry118 Squashed, thanks! |
|
/retest |
Update fork-external main with upstream main @ 452ec25 Related work items: containerd#5890, containerd#7647, containerd#9218, containerd#9233, containerd#9258, containerd#9270, containerd#9274, containerd#9279, containerd#9283, containerd#9286, containerd#9289, containerd#9290, containerd#9294, containerd#9295, containerd#9297, containerd#9305, containerd#9306, containerd#9308, containerd#9316, containerd#9317, containerd#9319, containerd#9320, containerd#9321
After run
TestRwLoop, there will leave a/dev/loopXnot removed.Autoclearis false inTestRwLoop, so/dev/loopXwill not be cleared automatically.Defer call
removeLoopto remove loop device at end.