*: fix typo and skip exec-io-drain-testcase in win

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2023-03-02 21:57:43 +08:00
parent 04dfd6275e
commit a9cbddd65d
3 changed files with 10 additions and 4 deletions

View File

@ -17,6 +17,7 @@
package integration package integration
import ( import (
"runtime"
"testing" "testing"
"time" "time"
@ -27,6 +28,11 @@ import (
) )
func TestContainerDrainExecIOAfterExit(t *testing.T) { func TestContainerDrainExecIOAfterExit(t *testing.T) {
// FIXME(fuweid): support it for windows container.
if runtime.GOOS == "windows" {
t.Skip("it seems that windows platform doesn't support detached process. skip it")
}
t.Log("Create a sandbox") t.Log("Create a sandbox")
sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox", "container-exec-drain-io-after-exit") sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox", "container-exec-drain-io-after-exit")

View File

@ -284,7 +284,7 @@ func drainExecIO(ctx context.Context, execProcess containerd.Process, attachDone
return nil return nil
} }
log.G(ctx).Debugf("Exec process %q exits but the io is still hold by other processes. Trying to delete exec process to release io", execProcess.ID()) log.G(ctx).Debugf("Exec process %q exits but the io is still held by other processes. Trying to delete exec process to release io", execProcess.ID())
_, err := execProcess.Delete(ctx, containerd.WithProcessKill) _, err := execProcess.Delete(ctx, containerd.WithProcessKill)
if err != nil { if err != nil {
if !errdefs.IsNotFound(err) { if !errdefs.IsNotFound(err) {
@ -292,5 +292,5 @@ func drainExecIO(ctx context.Context, execProcess containerd.Process, attachDone
execProcess.ID(), err) execProcess.ID(), err)
} }
} }
return fmt.Errorf("failed to drain exec process %q io because io is still hold by other processes", execProcess.ID()) return fmt.Errorf("failed to drain exec process %q io because io is still held by other processes", execProcess.ID())
} }

View File

@ -284,7 +284,7 @@ func drainExecIO(ctx context.Context, execProcess containerd.Process, attachDone
return nil return nil
} }
log.G(ctx).Debugf("Exec process %q exits but the io is still hold by other processes. Trying to delete exec process to release io", execProcess.ID()) log.G(ctx).Debugf("Exec process %q exits but the io is still held by other processes. Trying to delete exec process to release io", execProcess.ID())
_, err := execProcess.Delete(ctx, containerd.WithProcessKill) _, err := execProcess.Delete(ctx, containerd.WithProcessKill)
if err != nil { if err != nil {
if !errdefs.IsNotFound(err) { if !errdefs.IsNotFound(err) {
@ -292,5 +292,5 @@ func drainExecIO(ctx context.Context, execProcess containerd.Process, attachDone
execProcess.ID(), err) execProcess.ID(), err)
} }
} }
return fmt.Errorf("failed to drain exec process %q io because io is still hold by other processes", execProcess.ID()) return fmt.Errorf("failed to drain exec process %q io because io is still held by other processes", execProcess.ID())
} }