You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect that rake would let any jobs in flight finish up before reporting failure. Instead it reports failure, but some of the "simulated failure" messages print after rake exits, which ends up printing over my shell prompt.
I dug through the code a little bit and was able to come up with this as a suggested fix:
--- /home/alexg/.gem/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb~ 2022-02-06 12:28:46.800753532 -0600+++ /home/alexg/.gem/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb 2022-02-06 12:28:11.989792288 -0600@@ -119,15 +119,15 @@
end
# Run the given block with the thread startup and shutdown.
def run_with_threads
thread_pool.gather_history if options.job_stats == :history
yield
-+ ensure
thread_pool.join
if options.job_stats
stats = thread_pool.statistics
puts "Maximum active threads: #{stats[:max_active_threads]} + main"
puts "Total threads in play: #{stats[:total_threads_in_play]} + main"
end
ThreadHistoryDisplay.new(thread_pool.history).show if
This would make sure that we wait on threads in the thread pool, even if an exception was raised from FileUtils#create_shell_runner, for example.
Using rake: 13.0.6, ruby: ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
The text was updated successfully, but these errors were encountered:
This behavior can be seen with the following Rakefile, then running
rake all
:I expect that rake would let any jobs in flight finish up before reporting failure. Instead it reports failure, but some of the "simulated failure" messages print after rake exits, which ends up printing over my shell prompt.
I dug through the code a little bit and was able to come up with this as a suggested fix:
This would make sure that we wait on threads in the thread pool, even if an exception was raised from FileUtils#create_shell_runner, for example.
Using rake: 13.0.6, ruby: ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
The text was updated successfully, but these errors were encountered: