Merge pull request #1140 from lifupan/fix_taskdelete

Integration test task.Delete fix
This commit is contained in:
Lantao Liu 2019-05-08 18:21:20 -07:00 committed by GitHub
commit 51910edf0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ import (
"os"
"path/filepath"
"strings"
"syscall"
"testing"
"time"
@ -53,7 +54,9 @@ func TestSandboxCleanRemove(t *testing.T) {
require.NoError(t, err)
task, err := cntr.Task(ctx, nil)
require.NoError(t, err)
_, err = task.Delete(ctx, containerd.WithProcessKill)
// Kill the task with signal SIGKILL, once the task exited,
// the TaskExit event will trigger the task.Delete().
err = task.Kill(ctx, syscall.SIGKILL, containerd.WithKillAll)
require.NoError(t, err)
t.Logf("Sandbox state should be NOTREADY")