Skip to content

Commit

Permalink
Fix bug with bad instance numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
joakimk committed Jan 19, 2015
1 parent 300f875 commit bc7569a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.7.8

Fix test job bug that caused multiple jobs to use the same TEST_ENV_NUMBER.

This caused multiple processes to use the same databases, etc.

If you're seeing database deadlocks in tests, this will probably fix that.

0.7.7

Exit when file syncing fails so that you don't run tests for a version of the
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Using testbot with Rails 2:

# Add testbot to your Gemfile if you use bundler. You also need the plugin because
# Rails 2 does not load raketasks from gems.
ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.7.7'
ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.7.8'
script/generate testbot --connect 192.168.0.100

rake testbot:spec (or :rspec, :test, :features)
Expand Down
9 changes: 7 additions & 2 deletions lib/runner/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ def wait_for_jobs
end

@last_build_id = job.build_id
@instances << [ Thread.new { job.run(free_instance_number) },
free_instance_number, job ]

# Must be outside the thread or it will sometimes run
# multiple jobs using the same instance number.
instance_number = free_instance_number

@instances << [ Thread.new { job.run(instance_number) }, instance_number, job ]

loop do
clear_completed_instances
break unless max_instances_running?
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Testbot
# Don't forget to update readme and changelog
def self.version
version = "0.7.7"
version = "0.7.8"
dev_version_file = File.join(File.dirname(__FILE__), '..', '..', 'DEV_VERSION')
if File.exists?(dev_version_file)
version += File.read(dev_version_file)
Expand Down

0 comments on commit bc7569a

Please sign in to comment.