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
Fix hangs #49
Conversation
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.
LGTM – I added a few comments.
self.config.testing_CrashAppOnLaunch = YES; | ||
self.config.testing_NoAppWillRun = NO; | ||
BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration:self.config] run]; | ||
NSLog(@"%ld", (long)exitCode); |
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.
I would remove these NSLog (and the one in the next function).
// If it's not running and we passed the above checks (e.g., the tests are not yet completed) | ||
// then it must mean the app has crashed. | ||
// However, we have a short-circuit for tests because those may not actually run any app | ||
if (!isRunning && context.pid > 0 && !self.config.testing_NoAppWillRun) { |
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.
The testing_NoAppWillRun
variable is for the parsing tests right? I would then maybe also use it in the kill()
below where I am just looking for self.appPID == 0
for the same case.
This is the other half of the previous commit. I don't know how it didn't get committed.
PyCQA/isort#1429 fixed --check's output so that the error message and diff output are separated into STDERR and STDOUT rather than combined in STDOUT. This means we need to update our diff parsing function accordingly. Also fix the version parsing routine to read from STDOUT. This was busted for at least a few versions.
This incorporates the two tests that @ob added and includes fixes for detecting situations where the app fails to launch successfully, or we fail to detect that an app has frozen because the tests were not in the "Running" state. This also addresses an ask from @ob for a clearer message when the app crashes before tests have begun.