diff --git a/test/tools/repl_set_manager.rb b/test/tools/repl_set_manager.rb index 4bc5b37..f145de9 100644 --- a/test/tools/repl_set_manager.rb +++ b/test/tools/repl_set_manager.rb @@ -155,11 +155,11 @@ class ReplSetManager return secondary end - def add_node(n=nil) + def add_node(n=nil, &block) primary = get_node_with_state(1) con = get_connection(primary) - init_node(n || @mongods.length) + init_node(n || @mongods.length, &block) config = con['local']['system.replset'].find_one @config['version'] = config['version'] + 1 @@ -173,6 +173,12 @@ class ReplSetManager ensure_up end + def add_arbiter + add_node do |attrs| + attrs['arbiterOnly'] = true + end + end + def wait_for_death(pid) @retries.times do if `ps a | grep mongod`.include?("#{pid}")