Skip to content

Commit bca8a3f

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

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
@@ -1527,6 +1527,7 @@ func TestIssue9103(t *testing.T) {
15271527
for idx, tc := range []struct {
15281528
desc string
15291529
cntrOpts []NewContainerOpts
1530+
bakingFn func(ctx context.Context, t *testing.T, task Task)
15301531
expectedStatus ProcessStatus
15311532
}{
15321533
{
@@ -1536,6 +1537,7 @@ func TestIssue9103(t *testing.T) {
15361537
withProcessArgs("sleep", "30"),
15371538
),
15381539
},
1540+
bakingFn: func(context.Context, *testing.T, Task) {},
15391541
expectedStatus: Created,
15401542
},
15411543
{
@@ -1551,6 +1553,17 @@ func TestIssue9103(t *testing.T) {
15511553
BinaryName: "runc-fp",
15521554
}),
15531555
},
1556+
bakingFn: func(ctx context.Context, t *testing.T, task Task) {
1557+
waitCh, err := task.Wait(ctx)
1558+
require.NoError(t, err)
1559+
1560+
select {
1561+
case <-time.After(30 * time.Second):
1562+
t.Fatal("timeout")
1563+
case e := <-waitCh:
1564+
require.NoError(t, e.Error())
1565+
}
1566+
},
15541567
expectedStatus: Stopped,
15551568
},
15561569
} {
@@ -1570,6 +1583,8 @@ func TestIssue9103(t *testing.T) {
15701583

15711584
defer task.Delete(ctx, WithProcessKill)
15721585

1586+
tc.bakingFn(ctx, t, task)
1587+
15731588
status, err := task.Status(ctx)
15741589
require.NoError(t, err)
15751590
require.Equal(t, status.Status, tc.expectedStatus)

0 commit comments

Comments
 (0)