saucelabs / sauce-connect-action

A GitHub action to launch Sauce Connect Proxy.
https://github.com/marketplace/actions/sauce-connect-proxy-action
MIT License
13 stars 19 forks source link

fix: prevent unhandled promise rejection that caused action to exit and retries not to happen #60

Closed tjenkinson closed 1 year ago

tjenkinson commented 2 years ago

Previously if an error happened in the promise constructor in startSc (like the error that is rethrown as the result of a timeout) it would never be handled anywhere, causing node to exit with an error as a result of an unhandled promise rejection. The promise constructor does not really expect a function that returns a promise, and if it did that rejection would not be handled, as was the case here.

So this PR updates scartSc to not be wrapped in a new Promise.

It also increases the timeout as I saw 45 seconds was sometimes not enough.

fixes https://github.com/saucelabs/sauce-connect-action/issues/59

tjenkinson commented 1 year ago

Thanks for merging! Looks like the build needs updating in the main branch though