Skip to content

Commit 75ba518

Browse files
committed
Fix wrong log message & some tests
Signed-off-by: Min Uk Lee <[email protected]>
1 parent b1a3617 commit 75ba518

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

cmd/nerdctl/container_restart_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ func TestRestartIPCContainer(t *testing.T) {
7777

7878
const shmSize = "32m"
7979
baseContainerName := testutil.Identifier(t)
80-
base.Cmd("run", "-d", "--shm-size", shmSize, "--ipc", "shareable", "--name", baseContainerName, testutil.AlpineImage, "sleep", "infinity").AssertOK()
8180
defer base.Cmd("rm", "-f", baseContainerName).Run()
81+
base.Cmd("run", "-d", "--shm-size", shmSize, "--ipc", "shareable", "--name", baseContainerName, testutil.AlpineImage, "sleep", "infinity").AssertOK()
8282

8383
sharedContainerName := fmt.Sprintf("%s-shared", baseContainerName)
84-
base.Cmd("run", "-d", "--name", sharedContainerName, fmt.Sprintf("--ipc=container:%s", baseContainerName), testutil.AlpineImage, "sleep", "infinity").AssertOK()
8584
defer base.Cmd("rm", "-f", sharedContainerName).Run()
85+
base.Cmd("run", "-d", "--name", sharedContainerName, fmt.Sprintf("--ipc=container:%s", baseContainerName), testutil.AlpineImage, "sleep", "infinity").AssertOK()
8686

8787
base.Cmd("stop", baseContainerName).Run()
8888
base.Cmd("stop", sharedContainerName).Run()

cmd/nerdctl/container_run_linux_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ func TestRunIPCShareableRemoveMount(t *testing.T) {
8686
container := testutil.Identifier(t)
8787

8888
base.Cmd("run", "--name", container, "--ipc", "shareable", testutil.AlpineImage, "sleep", "0").AssertOK()
89-
result := base.Cmd("rm", container).Run()
90-
fmt.Println(result.Stdout())
91-
fmt.Println(result.Stderr()) // time="2023-12-03T12:53:17Z" level=warning msg="failed to remove container state dir ~/.local/share/nerdctl/1935db59/containers/nerdctl-test/cc44924f9b1af6cd22f599c1bb11303b82b7dd076ce09777b048bda84e744b7e" error="<nil>"
89+
base.Cmd("rm", container).AssertOK()
9290
}
9391

9492
func TestRunIPCContainerNotExists(t *testing.T) {

pkg/containerutil/containerutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func Stop(ctx context.Context, container containerd.Container, timeout *time.Dur
343343
// defer umount
344344
defer func() {
345345
if err := ipcutil.CleanUp(ipc); err != nil {
346-
log.G(ctx).Warnf("failed to clean up IPC container %s: %s", container.ID(), err)
346+
log.G(ctx).Warnf("failed to clean up IPC container %s: %s", container.ID(), err)
347347
}
348348
}()
349349

0 commit comments

Comments
 (0)