Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TestExecCommandAgent flakiness on AL1 #4138

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Conversation

amogh09
Copy link
Contributor

@amogh09 amogh09 commented Apr 8, 2024

Summary

TestExecCommandAgent has been quite flaky on AL1. The test starts a /kill process inside the test container to kill a running ExecCommandAgent process. However, it does not wait for /kill to finish before checking that ExecCommandAgent has been killed causing the test to fail with the error below.

--- FAIL: TestExecCommandAgent (1.62s)
    engine_sudo_linux_integ_test.go:740: 
        	Error Trace:	/opt/amazon-ecs-agent/go/src/github.com/aws/amazon-ecs-agent/agent/engine/engine_sudo_linux_integ_test.go:740
        	            				/opt/amazon-ecs-agent/go/src/github.com/aws/amazon-ecs-agent/agent/engine/engine_sudo_linux_integ_test.go:681
        	            				/opt/amazon-ecs-agent/go/src/github.com/aws/amazon-ecs-agent/agent/engine/engine_sudo_linux_integ_test.go:454
        	Error:      	Not equal: 
        	            	expected: false
        	            	actual  : true
        	Test:       	TestExecCommandAgent
        	Messages:   	SSM agent was not found in container's process list

This PR fixes this issue by making the test verify that /kill process has finished before verifying that ExecCommandAgent process has been killed.

Testing

Reproduced the test failure locally. Ran the test many times after making the change in this PR. It did not fail.

New tests cover the changes: no

Description for the changelog

Bugfix: Fix flakiness of TestExecCommandAgent

Does this PR include breaking model changes? If so, Have you added transformation functions?

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 changed the base branch from master to dev April 8, 2024 21:21
@amogh09 amogh09 changed the title Fix AL1 integ test flakiness Fix TestExecCommandAgent flakiness on AL1 Apr 8, 2024
@amogh09 amogh09 marked this pull request as ready for review April 8, 2024 22:36
@amogh09 amogh09 requested a review from a team as a code owner April 8, 2024 22:36
@amogh09 amogh09 merged commit ddc7d5d into aws:dev Apr 9, 2024
40 checks passed
@harishxr harishxr mentioned this pull request Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants