aws-deadline / deadline-cloud-test-fixtures

This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages
Apache License 2.0
9 stars 13 forks source link

fix: resolve get_worker_id race by waiting for worker.json to get written #133

Closed ddneilson closed 2 months ago

ddneilson commented 2 months ago

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.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud