Optimize nap times while the runner waiting for a vm #1513
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, Furkan modified the workflow to update the firewall rule during VM provisioning. Now, it's updated after the VM reaches the
wait
label. Consequently, if the runner doesn't check the vm in the time between the VM reaching thewait
label and the start of the firewall rule update, it must wait for the firewall rule update to complete.The VM model has a
provisioned_at
timestamp, which provides a better way to verify whether the VM has been provisioned.Furthermore, if we nap for 5 seconds at this point, we could potentially wait an extra 5 seconds, even if the VM is already provisioned, until the next schedule. We know that our fastest VM provisioning time is 18 seconds. Therefore, if we run this label for the first time, we can wait for 18 seconds. This PR increases the checking frequency to 1 second after the initial run, allowing the runner to detect a provisioned VM more promptly.