Skip to content

Instantly share code, notes, and snippets.

@arthurschreiber
Created April 9, 2013 18:45
Show Gist options
  • Save arthurschreiber/5348266 to your computer and use it in GitHub Desktop.
Save arthurschreiber/5348266 to your computer and use it in GitHub Desktop.
class RepositoryThreadedPushTest < Rugged::SandboxedTestCase
def setup
super
sandbox_init("testrepo.git")
@repos = (1..10).collect do |i|
sandbox_clone("testrepo.git", "testrepo#{i}.git").tap { |r| r.config['core.bare'] = true }
sandbox_clone("testrepo#{i}.git", "testrepo#{i}")
end
end
def test_threaded_push
threads = @repos.collect do |repo|
Thread.new do
2000.times do
repo.push("origin", ["+refs/heads/master:refs/heads/master"])
end
end
end
threads.each {|th| th.join}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment