From 7f1c65d2ed0af31898e6c09f6c024e3bbd6f54e7 Mon Sep 17 00:00:00 2001 From: Adnan Khan Date: Tue, 30 Jan 2018 16:27:41 -0800 Subject: [PATCH] engine: fix flakey TestRemoveEvents since we "Emit a couple of events for the task before cleanup finishes." We should also add corresponding client.EXPECT().StopContainer() --- agent/engine/docker_task_engine_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/engine/docker_task_engine_test.go b/agent/engine/docker_task_engine_test.go index 9848397f7dc..c34a033ef8c 100644 --- a/agent/engine/docker_task_engine_test.go +++ b/agent/engine/docker_task_engine_test.go @@ -470,6 +470,8 @@ func TestRemoveEvents(t *testing.T) { eventStream <- createDockerEvent(api.ContainerStopped) eventStream <- createDockerEvent(api.ContainerStopped) }).Return(nil) + + client.EXPECT().StopContainer(gomock.Any(), gomock.Any()).AnyTimes() imageManager.EXPECT().RemoveContainerReferenceFromImageState(gomock.Any()) // This ensures that managedTask.waitForStopReported makes progress