Skip to content

Commit

Permalink
integration: deflake TestIssue9103
Browse files Browse the repository at this point in the history
Fixes: #9334

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit dac056f)
  • Loading branch information
fuweid authored and henry118 committed Nov 8, 2023
1 parent 124c95e commit 5dbc258
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions integration/client/container_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,7 @@ func TestIssue9103(t *testing.T) {
for idx, tc := range []struct {
desc string
cntrOpts []NewContainerOpts
bakingFn func(ctx context.Context, t *testing.T, task Task)
expectedStatus ProcessStatus
}{
{
Expand All @@ -1540,6 +1541,7 @@ func TestIssue9103(t *testing.T) {
withProcessArgs("sleep", "30"),
),
},
bakingFn: func(context.Context, *testing.T, Task) {},
expectedStatus: Created,
},
{
Expand All @@ -1555,6 +1557,17 @@ func TestIssue9103(t *testing.T) {
BinaryName: "runc-fp",
}),
},
bakingFn: func(ctx context.Context, t *testing.T, task Task) {
waitCh, err := task.Wait(ctx)
require.NoError(t, err)

select {
case <-time.After(30 * time.Second):
t.Fatal("timeout")
case e := <-waitCh:
require.NoError(t, e.Error())
}
},
expectedStatus: Stopped,
},
} {
Expand All @@ -1574,6 +1587,8 @@ func TestIssue9103(t *testing.T) {

defer task.Delete(ctx, WithProcessKill)

tc.bakingFn(ctx, t, task)

status, err := task.Status(ctx)
require.NoError(t, err)
require.Equal(t, status.Status, tc.expectedStatus)
Expand Down

0 comments on commit 5dbc258

Please sign in to comment.