mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
test(kuberuntime): deflake TestRemoveContainer
Signed-off-by: knight42 <anonymousknight96@gmail.com>
This commit is contained in:
parent
14a11060a0
commit
cfeddcf654
@ -79,9 +79,12 @@ func TestRemoveContainer(t *testing.T) {
|
||||
|
||||
err = m.removeContainer(containerID)
|
||||
assert.NoError(t, err)
|
||||
// Verify container log is removed
|
||||
|
||||
assert.Equal(t, []string{expectedContainerLogPath, expectedContainerLogPathRotated, expectedContainerLogSymlink}, fakeOS.Removes)
|
||||
// Verify container log is removed.
|
||||
// We could not predict the order of `fakeOS.Removes`, so we use `assert.ElementsMatch` here.
|
||||
assert.ElementsMatch(t,
|
||||
[]string{expectedContainerLogSymlink, expectedContainerLogPath, expectedContainerLogPathRotated},
|
||||
fakeOS.Removes)
|
||||
// Verify container is removed
|
||||
assert.Contains(t, fakeRuntime.Called, "RemoveContainer")
|
||||
containers, err := fakeRuntime.ListContainers(&runtimeapi.ContainerFilter{Id: containerID})
|
||||
|
Loading…
Reference in New Issue
Block a user