Someone reported an issue of Sauce Connect launcher failing with ENOENT which is normally impossible because we download Sauce Connect before we run it. It seems that there is a race condition where checking if the Sauce Connect binary was downloaded fails when looking for the version. The execution happens as follows:
check if the binary was downloaded
if no -> download
if yes continue
check if version is the one that has been downloaded
if no -> download expected version
if yes finish
The race condition seem to happen when the check if the binary exists was successful but then the consecutive version check fails if in between someone cleaned the binary which can happen in an CI/CD environment where dependencies are shared.
This patch introduces a retry to see if this race condition can be caught.
Someone reported an issue of Sauce Connect launcher failing with ENOENT which is normally impossible because we download Sauce Connect before we run it. It seems that there is a race condition where checking if the Sauce Connect binary was downloaded fails when looking for the version. The execution happens as follows:
The race condition seem to happen when the check if the binary exists was successful but then the consecutive version check fails if in between someone cleaned the binary which can happen in an CI/CD environment where dependencies are shared.
This patch introduces a retry to see if this race condition can be caught.