amazon-ecs-agent
amazon-ecs-agent copied to clipboard
Integration testing for container restart policy
Summary
Add integration testing to ensure that as part of introducing container restart policy feature to ECS Agent:
- Agent can synchronize container state related to container restart policy feature via on Agent restart
- Agent does not restart containers unexpectedly
- Agent can get restart stats for a container via the stats engine
Implementation details
- Modify
TestEngineSynchronize
such that the container has fields related to container restart policy feature populated - Introduce
TestContainerDoesNotRestartWhenShouldNotRestart
which includes the following 4 test cases:- container does not restart when policy disabled
- container does not restart when policy not configured
- container does not restart when policy enabled and container exits with ignored exit code
- container does not restart when policy enabled and container exits before AttemptResetPeriod
- Introduce
TestRestartStats
- this test is similar to existing testTestStorageStats
Testing
New tests cover the changes: yes (or N/A, since only integration tests are changed as part of this pull request)
Description for the changelog
N/A (Enhancement: Integration testing for container restart policy)
Does this PR include breaking model changes? If so, Have you added transformation functions?
No
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.