testbot 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.3.7
2
+
3
+ The runner now checks right away for another job if it got one last time around.
4
+
1
5
  0.3.6
2
6
 
3
7
  Added Rails 2 generator support.
@@ -68,7 +68,7 @@ Using testbot with Rails 3:
68
68
 
69
69
  Using testbot with Rails 2:
70
70
 
71
- ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.3.6'
71
+ ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.3.7'
72
72
  script/generate testbot --connect 192.168.0.100
73
73
 
74
74
  rake testbot:spec (or :test, :features)
@@ -5,7 +5,8 @@ require 'ostruct'
5
5
  require File.dirname(__FILE__) + '/shared/ssh_tunnel'
6
6
  require File.dirname(__FILE__) + '/adapters/adapter'
7
7
 
8
- TIME_BETWEEN_POLLS = 1
8
+ TIME_BETWEEN_NORMAL_POLLS = 1
9
+ TIME_BETWEEN_QUICK_POLLS = 0.1
9
10
  TIME_BETWEEN_PINGS = 5
10
11
  TIME_BETWEEN_VERSION_CHECKS = 60
11
12
  MAX_CPU_USAGE_WHEN_IDLE = 50
@@ -119,9 +120,11 @@ class Runner
119
120
  end
120
121
 
121
122
  def wait_for_jobs
123
+ last_check_found_a_job = false
122
124
  loop do
123
- sleep TIME_BETWEEN_POLLS
124
- check_for_update if time_for_update?
125
+ sleep (last_check_found_a_job ? TIME_BETWEEN_QUICK_POLLS : TIME_BETWEEN_NORMAL_POLLS)
126
+
127
+ check_for_update if !last_check_found_a_job && time_for_update?
125
128
 
126
129
  # Only get jobs from one requester at a time
127
130
  next_params = base_params
@@ -138,7 +141,8 @@ class Runner
138
141
 
139
142
  next_job = Server.get("/jobs/next", :query => next_params) rescue nil
140
143
  next if next_job == nil
141
-
144
+ last_check_found_a_job = true
145
+
142
146
  job = Job.new(*([ self, next_job.split(',') ].flatten))
143
147
  if first_job_from_requester?
144
148
  fetch_code(job)
@@ -8,7 +8,7 @@ unless defined?(Testbot)
8
8
  require 'railtie' if defined?(Rails)
9
9
 
10
10
  # Don't forget to update readme and changelog
11
- VERSION = "0.3.6"
11
+ VERSION = "0.3.7"
12
12
 
13
13
  SERVER_PID = "/tmp/testbot_server.pid"
14
14
  RUNNER_PID = "/tmp/testbot_runner.pid"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testbot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 6
10
- version: 0.3.6
9
+ - 7
10
+ version: 0.3.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Joakim Kolsj\xC3\xB6"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-28 00:00:00 +01:00
18
+ date: 2010-12-01 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency