-
Notifications
You must be signed in to change notification settings - Fork 14
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
reporting pass in console, but syntax error in log #31
Comments
There's probably some at_exit handler masking the failed exit status propagation. Unfortunately, Rails makes Process::Status#to_json less useful so please edit the SIGCHLD handler in your lib/tork/master.rb as follows: diff --git a/lib/tork/master.rb b/lib/tork/master.rb
index fba8ce1..6ac915a 100644
--- a/lib/tork/master.rb
+++ b/lib/tork/master.rb
@@ -86,7 +86,7 @@ private
if command = @command_by_worker_pid.delete(child_pid)
@worker_number_pool.push command.last
command[0] = if child_status.success? then :pass else :fail end
- @client.send command.push(child_status)
+ @client.send command.push(child_status.inspect)
else
warn "tork-master: unknown child exited: #{wait2_array.inspect}"
end Let's see what exit status is really being sent back from the worker to the master. Thanks. |
after making the change, the output looks like this
|
Thanks for your feedback. As I suspected, something is masking the failed exit status. Tork sees exit status 0 so it thinks your test file has passed. Please try running your test file directly:
If you get 0 again, then you need to debug your test environment (spec helper, libraries you use, etc). |
|
That's strange. What version of Ruby, RSpec, and Rails are you using? A syntax error in a forked child propagates correctly to its parent here:
|
Oh I see you have this project on GitHub. I'll try to debug too. :) |
Got it! I was able to reproduce the error here. Will debug and let you know. |
Found the bug! The culprit is RSpec! 👊 Because there was a syntax error, none of the specs in that Ruby file are registered with RSpec. So when RSpec's at_exit handler runs, it finds no specs to run and simply calls
I found this by adding the following monkey patch at the top of your module Kernel
alias _63c4ec09_258b_46a9_b39c_98620916c755 exit
def exit *args
require 'pp'
pp __method__ => {
:$! => $!,
:args => args,
:self => self,
:caller => caller,
}
_63c4ec09_258b_46a9_b39c_98620916c755 *args
end
end |
Submitted a patch to RSpec that fixes this bug. Closing. |
Awesome :) Thanks for tork and taking the time |
You're welcome! ✨ |
tork will show
the log will have
kind of threw me for a loop, when stuff I knew should be failing was being reported as passing
The text was updated successfully, but these errors were encountered: