From c4f03b27ee277c6018764f197c9f808f724f129b Mon Sep 17 00:00:00 2001 From: Swagat Bora Date: Mon, 4 Nov 2024 21:36:32 +0000 Subject: [PATCH] add sleep before task delete Signed-off-by: Swagat Bora --- runtime/service_integ_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/service_integ_test.go b/runtime/service_integ_test.go index 122d9c9a..72858425 100644 --- a/runtime/service_integ_test.go +++ b/runtime/service_integ_test.go @@ -946,6 +946,9 @@ func startAndWaitTask(ctx context.Context, t testing.TB, c containerd.Container) assert.NoError(t, exitStatus.Error(), "failed to retrieve exitStatus") assert.Equal(t, uint32(0), exitStatus.ExitCode()) + // Introduce some wait before deleting the task to allow for the data to be streamed + time.Sleep(5 * time.Second) + status, err := task.Delete(ctx) assert.NoErrorf(t, err, "failed to delete task %q after exit", c.ID()) if status != nil { @@ -2579,6 +2582,9 @@ func TestAttach_Isolated(t *testing.T) { <-ch + // Introduce some wait before deleting the task + time.Sleep(5 * time.Second) + _, err = t2.Delete(ctx) require.NoError(t, err)