-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Show output from tests when process is killed via CTRL+C #66
Conversation
I've tested it and it works flawlesly! Great work! 👍
|
if ($this->handleInterrupt) { | ||
$this->interrupted = FALSE; | ||
pcntl_signal(SIGINT, function() { $this->interrupted = TRUE; }); | ||
} |
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.
It is a good practice to add pcntl_signal(SIGINT, SIG_DFL);
into handler body.
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.
And $this
does not exists in closure in older PHP.
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 have added pcntl_signal(SIGINT, SIG_DFL);
to the end of run()
and removed $this
from closure.
This is probably expected
But the already running tests should be thrown away because they didn't in fact failed, they were killed. |
@lm much better! |
Fixed (assessing of killed jobs). |
@@ -85,11 +97,21 @@ public function run() | |||
} | |||
|
|||
foreach ($running as $key => $job) { | |||
$this->dispatchSignal(); |
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.
Why dispatch there? Would not already finished job pass?
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.
At this point it's not clear if job completed or was killed by signal, so is better to skip result check.
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.
Now I see.
I like it too. After traveling, I'll work on it. |
Merged 8021168 |
👍 |
Love it! |
Runner now checks for SIGINT and after receiving signal invokes output handlers and returns.