Skip to content

Commit

Permalink
Fix TestDockerStateToContainerState integ test.
Browse files Browse the repository at this point in the history
During the workflow of TestDockerStateToContainerState, it starts a container and checks whether it's running by inspecting it. However, the container it starts exit immediately, so it's possible that when we check whether the container is running it's already stopped. This leads to flakey test as per aws#1899. Fixing by letting the container keep running rather than exit itself.
  • Loading branch information
fenxiong committed Mar 6, 2019
1 parent 6744fa0 commit 1b6a8d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/engine/engine_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ func TestDockerStateToContainerState(t *testing.T) {
testTask := createTestTask("test_task")
container := testTask.Containers[0]

// let the container keep running to prevent the edge case where it's already stopped when we check whether
// it's running
container.Command = []string{"-loop=true"}

client, err := sdkClient.NewClientWithOpts(sdkClient.WithHost(endpoint), sdkClient.WithVersion(sdkclientfactory.GetDefaultVersion().String()))
require.NoError(t, err, "Creating go docker client failed")

Expand Down

0 comments on commit 1b6a8d3

Please sign in to comment.