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.*
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?