-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
β π· kill browserstack execution early #3096
Conversation
When detecting an unrecoverable error in the command output, or if the command doesn't print anything within 5 minutes, let's kill it early, we don't wait for nothing.
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #3096 +/- ##
==========================================
- Coverage 93.66% 93.17% -0.49%
==========================================
Files 276 276
Lines 7624 7624
Branches 1710 1710
==========================================
- Hits 7141 7104 -37
- Misses 483 520 +37 β View full report in Codecov by Sentry. |
scripts/test/bs-wrapper.js
Outdated
} | ||
|
||
clearTimeout(timeoutId) | ||
setTimeout(() => killIt('no output timeout'), NO_OUTPUT_TIMEOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π¨ warning: β
setTimeout(() => killIt('no output timeout'), NO_OUTPUT_TIMEOUT) | |
timeoutId = setTimeout(() => killIt('no output timeout'), NO_OUTPUT_TIMEOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah good catch, that's why it didn't work :D
scripts/test/bs-wrapper.js
Outdated
} | ||
|
||
function killIt(message) { | ||
if (!isKilled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β question: β Do we need this isKilled
variable? Instead, can we return on line 74? (unless child.kill('SIGTERM')
does not terminate immediately and somehow some more output is processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless child.kill('SIGTERM') does not terminate immediately and somehow some more output is processed
"SIGTERM" is typically a "graceful exit" -> the process can catch it and continue its execution to clean things up before exiting. So it is possible to have some output after a SIGTERM.
In practice, I'm not sure it happens in this particular situation (= karma and wdio processes). Sending the signal multiple times shouldn't hurt, so let's simplify the code!
Bundles Sizes Evolution
π CPU Performance
π§ Memory Performance
π RealWorld |
Motivation
e2e-bs tests are still quite flaky, sometimes because of a BrowserStack issue (?). Because we can run a single e2e-bs job at a time, we should detect and stop the jobs as soon as possible so other can be run.
Changes
When detecting an unrecoverable error in the command output, or if the command doesn't print anything within 5 minutes, let's kill it early, we don't wait for nothing.
For now, we don't implement a retry mechanism, but it could be done later.
Testing
I have gone over the contributing documentation.