integration: add testcase to drain exec IO in time

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu 2023-03-03 09:20:02 +08:00
parent ffebcb1223
commit 55e25f1644

View File

@ -65,4 +65,8 @@ func TestContainerDrainExecIOAfterExit(t *testing.T) {
t.Log("Exec in container") t.Log("Exec in container")
_, _, err = runtimeService.ExecSync(cn, []string{"sh", "-c", "sleep 365d &"}, 5*time.Second) _, _, err = runtimeService.ExecSync(cn, []string{"sh", "-c", "sleep 365d &"}, 5*time.Second)
require.ErrorContains(t, err, "failed to drain exec process") require.ErrorContains(t, err, "failed to drain exec process")
t.Log("Exec in container")
_, _, err = runtimeService.ExecSync(cn, []string{"sh", "-c", "sleep 2s &"}, 10*time.Second)
require.NoError(t, err, "should drain IO in time")
} }