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: resolve get_worker_id race by waiting for worker.json to get written #133

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

ddneilson
Copy link
Contributor

What was the problem/requirement? (What/Why)

When starting a worker using PosixInstanceWorker it can sometimes be the case that we query for the Worker's id before the worker.json file has been written to disk. If this happens then the test will fail.

What was the solution? (How)

Repeatedly query for the worker.json file in a delaying loop, up to a maximum of 10 queries after about a minute. Note that this mitigation was already implemented for the Windows agent, but was missing in the Linux agent.

What is the impact of this change?

Fewer flaky tests.

How was this change tested?

I ran the deadline-cloud-worker-agent e2e tests on linux.

Was this change documented?

N/A

Is this a breaking change?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ddneilson ddneilson requested a review from a team as a code owner August 2, 2024 19:13
AWS-Samuel
AWS-Samuel previously approved these changes Aug 2, 2024
…tten

Problem:
 When starting a worker using PosixInstanceWorker it can sometimes be
the case that we query for the Worker's id before the worker.json file
has been written to disk. If this happens then the test will fail.

Solution:
 Repeatedly query for the worker.json file in a delaying loop, up to a
maximum of 10 queries after about a minute.

Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com>
Copy link

sonarcloud bot commented Aug 2, 2024

@ddneilson ddneilson merged commit 1f27578 into aws-deadline:mainline Aug 2, 2024
15 checks passed
@ddneilson ddneilson deleted the wait_for_state_file branch August 2, 2024 20:45
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