tourbus 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/tour_bus.rb +12 -1
  2. metadata +3 -3
@@ -43,12 +43,23 @@ class TourBus < Monitor
43
43
 
44
44
  def run
45
45
  threads = []
46
+ threads_ready = 0
47
+ start_running = false
48
+ mutex = Mutex.new
46
49
  tour_name = "#{total_runs} runs: #{concurrency}x#{number} of #{tours * ','}"
47
50
  started = Time.now.to_f
48
51
  concurrency.times do |conc|
49
52
  log "Starting #{tour_name}"
50
53
  threads << Thread.new do
51
54
  runner_id = next_runner_id
55
+ mutex.lock
56
+ threads_ready += 1
57
+ if threads_ready == concurrency
58
+ log "All Runners are ready -- STARTING!"
59
+ start_running = true
60
+ end
61
+ mutex.unlock
62
+ sleep 0.05 until start_running
52
63
  runs,tests,passes,fails,errors,start = 0,0,0,0,0,Time.now.to_f
53
64
  bm = Benchmark.measure do
54
65
  runner = Runner.new(@host, @tours, @number, runner_id, @test_list)
@@ -61,7 +72,7 @@ class TourBus < Monitor
61
72
  log "Benchmark for runner #{runner_id}: #{bm}"
62
73
  end
63
74
  end
64
- log "All Runners started!"
75
+ log "Initializing #{concurrency} Runners..."
65
76
  threads.each {|t| t.join }
66
77
  finished = Time.now.to_f
67
78
  log '-' * 80
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Brady
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2009-11-22 00:00:00 -07:00
20
+ date: 2010-03-23 00:00:00 -06:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency