Skip to content

Commit 5dbc258

Browse files
fuweidhenry118
authored andcommitted
integration: deflake TestIssue9103
Fixes: #9334 Signed-off-by: Wei Fu <[email protected]> (cherry picked from commit dac056f)
1 parent 124c95e commit 5dbc258

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

integration/client/container_linux_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ func TestIssue9103(t *testing.T) {
15311531
for idx, tc := range []struct {
15321532
desc string
15331533
cntrOpts []NewContainerOpts
1534+
bakingFn func(ctx context.Context, t *testing.T, task Task)
15341535
expectedStatus ProcessStatus
15351536
}{
15361537
{
@@ -1540,6 +1541,7 @@ func TestIssue9103(t *testing.T) {
15401541
withProcessArgs("sleep", "30"),
15411542
),
15421543
},
1544+
bakingFn: func(context.Context, *testing.T, Task) {},
15431545
expectedStatus: Created,
15441546
},
15451547
{
@@ -1555,6 +1557,17 @@ func TestIssue9103(t *testing.T) {
15551557
BinaryName: "runc-fp",
15561558
}),
15571559
},
1560+
bakingFn: func(ctx context.Context, t *testing.T, task Task) {
1561+
waitCh, err := task.Wait(ctx)
1562+
require.NoError(t, err)
1563+
1564+
select {
1565+
case <-time.After(30 * time.Second):
1566+
t.Fatal("timeout")
1567+
case e := <-waitCh:
1568+
require.NoError(t, e.Error())
1569+
}
1570+
},
15581571
expectedStatus: Stopped,
15591572
},
15601573
} {
@@ -1574,6 +1587,8 @@ func TestIssue9103(t *testing.T) {
15741587

15751588
defer task.Delete(ctx, WithProcessKill)
15761589

1590+
tc.bakingFn(ctx, t, task)
1591+
15771592
status, err := task.Status(ctx)
15781593
require.NoError(t, err)
15791594
require.Equal(t, status.Status, tc.expectedStatus)

0 commit comments

Comments
 (0)