Permalink
Browse files

[Leader Election] A real test case

  • Loading branch information...
1 parent d1b4413 commit 52691442cd9588bebec5cf017c2b899c22864c80 @seshness seshness committed Dec 13, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 new_sandbox/tests/tc_leader_election.rb
View
6 new_sandbox/tests/tc_leader_election.rb
@@ -31,7 +31,7 @@ def test_simple
puts "We have 3 hosts: #{hosts.inspect}"
q = Queue.new
- 10.times { q.push(true) }
+ ports.length.times { q.push(true) }
respondedp = {}
lms.each do |lm|
@@ -47,9 +47,9 @@ def test_simple
lms.each do |lm|
lm.register_callback(:leader) do |cb|
cb.each do |row|
- if row.host == "127.0.0.1:3001" and !respondedp[lm]
+ if row.host == "127.0.0.1:#{ports.min}" and !respondedp[lm]
q.pop
- #respondedp[lm] = true
+ respondedp[lm] = true
end
end
end

0 comments on commit 5269144

Please sign in to comment.