Sha256: df5759d79dc38f6eff3ebbf22eded659a606c20b2519007bc38ba4ce3b0335af
Contents?: true
Size: 688 Bytes
Versions: 8
Compression:
Stored size: 688 Bytes
Contents
#!/usr/bin/env ruby require "./lib/kommando" def stress iterations iterations.times do |i| k = Kommando.new "rake", { timeout: 10 } k.run unless k.code == 0 print "!FAILED! waiting for 3 seconds" sleep 3 # wait for sync puts k.out exit 1 end print "." end end number_of_threads = if ARGV[0] ARGV[0].to_i else 3 end number_of_iterations = if ARGV[1] ARGV[1].to_i else 100 end puts "starting #{number_of_threads} threads for #{number_of_iterations} iterations" threads = [] number_of_threads.times do |i| threads << Thread.new do stress number_of_iterations end end threads.each do |thread| thread.join end
Version data entries
8 entries across 8 versions & 1 rubygems