Skip to content

Commit

Permalink
Fix TestShutdownOrder and turn on debug log for integ test.
Browse files Browse the repository at this point in the history
TestShutdownOrder sometimes ended up hanging because we didn't wait for task stopped state change which in turns can block task engine shut down. Fixing by waiting for the task state change.
  • Loading branch information
fenxiong committed May 2, 2019
1 parent df83ed3 commit b40c4cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ cni-plugins: get-cni-sources .out-stamp build-ecs-cni-plugins build-vpc-cni-plug

ifeq (${BUILD_PLATFORM},aarch64)
run-integ-tests: test-registry gremlin container-health-check-image run-sudo-tests
. ./scripts/shared_env && go test -tags integration -timeout=25m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
. ./scripts/shared_env && ECS_LOGLEVEL=debug go test -tags integration -timeout=25m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
else
run-integ-tests: test-registry gremlin container-health-check-image run-sudo-tests
. ./scripts/shared_env && go test -race -tags integration -timeout=25m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
. ./scripts/shared_env && ECS_LOGLEVEL=debug go test -race -tags integration -timeout=25m -v ./agent/engine/... ./agent/stats/... ./agent/app/...
endif

ifeq (${BUILD_PLATFORM},aarch64)
Expand Down
1 change: 1 addition & 0 deletions agent/engine/ordering_integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ func TestShutdownOrder(t *testing.T) {
assert.Equal(t, expectedA.(api.ContainerStateChange).Status, status.ContainerStopped)
assert.Equal(t, expectedA.(api.ContainerStateChange).ContainerName, "C")

verifyTaskIsStopped(stateChangeEvents, testTask)
close(finished)
}()

Expand Down
2 changes: 1 addition & 1 deletion scripts/run-integ-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Invoke-Expression "${PSScriptRoot}\..\misc\netkitten\build.ps1"
$cwd = (pwd).Path
try {
cd "${PSScriptRoot}"
go test -race -tags integration -timeout=40m -v ../agent/engine ../agent/stats ../agent/app
$env:ECS_LOGLEVEL = 'debug'; go test -race -tags integration -timeout=40m -v ../agent/engine ../agent/stats ../agent/app
$testsExitCode = $LastExitCode
} finally {
cd "$cwd"
Expand Down

0 comments on commit b40c4cb

Please sign in to comment.