-
Notifications
You must be signed in to change notification settings - Fork 254
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
Incorrect exit code #232
Comments
Can you simplify this further, for example:
Does this also happen when using a plain Ruby script without rake ?
Does it also happen when not using the 'raise brake' ?
…On Thu, Dec 20, 2018, 13:47 Nikita Lastovych ***@***.*** wrote:
I am trying to execute two rake tasks in parallel in next way:
task :run_parallel_regression do Parallel.map(%i[thread1 thread2]) do
|task| Rake::Task[task].invoke raise Parallel::Break end end
If thread1 will be finished first and the result will fail but thread2
will succeed Parallel.map exit code will be 0. What I should change in my
code to make Parallel.map exit with code 1 if one of the sub-processes
failed?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#232>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAsZ33GYkimj3YLmuUWzOmUCU6mLSV0ks5u64bNgaJpZM4ZcIOu>
.
|
If I will not use raise break I will get this error even if both sub-processes succeed Caused by: Not really sure how to implement it without rake tasks. |
so this works: require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'parallel'
end
Parallel.map([1,2]) { raise }
... the same with a Rakefile: require 'parallel'
task :foo do
Parallel.map([1,2]) { raise "hi" }
end
rake foo
rake aborted!
hi then nested rake task ... getting a little strange, but still kinda as expected: task :bar do
raise "hi"
end
task :foo do
Parallel.map([1,2]) do
Rake::Task["bar"].invoke
end
end
rake foo
rake aborted!
Parallel::UndumpableException: RuntimeError: hi and ordering:
both work as expected ... |
I am trying to execute two rake tasks in parallel in next way:
task :run_parallel_regression do Parallel.map(%i[thread1 thread2]) do |task| Rake::Task[task].invoke raise Parallel::Break end end
If thread1 will be finished first and the result will fail but thread2 will succeed Parallel.map exit code will be 0. What I should change in my code to make Parallel.map exit with code 1 if one of the sub-processes failed?
The text was updated successfully, but these errors were encountered: