aws-deadline / deadline-cloud-worker-agent

The AWS Deadline Cloud worker agent can be used to run a worker in an AWS Deadline Cloud fleet.
Apache License 2.0
15 stars 21 forks source link

test: make linux worker restart test less susceptible to races #472

Closed YutongLi291 closed 2 weeks ago

YutongLi291 commented 2 weeks ago

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

The linux worker restart test had a minor unlikely race condition because the datetime.now() was returning the time precise up to the millisecond, while the service start time in the linux command returned was precise up to the second. This meant that when comparing the 2, there were some rare test failures if the linux process started after when we killed the process but within the same second, and thus failed the test anyway due to the precision differences.

What was the solution? (How)

Make both of the timestamps precise up to the second. Also wait a second after the initial process start, so that we can make sure that the linux process starttime is expected.

What is the impact of this change?

Less flaky tests

How was this change tested?


hatch run e2e-test```
### Was this change documented?
No
### 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 weeks 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