old_contents: """
  This file is part of Arakoon, a distributed key-value store. Copyright
  (C) 2010 Incubaid BVBA
  
  Licensees holding a valid Incubaid license may use this file in
  accordance with Incubaid's Arakoon commercial license agreement. For
  more information on how to enter into this agreement, please contact
  Incubaid (contact details can be found on www.arakoon.org/licensing).
  
  Alternatively, this file may be redistributed and/or modified under
  the terms of the GNU Affero General Public License version 3, as
  published by the Free Software Foundation. Under this license, this
  file is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  nFITNESS FOR A PARTICULAR PURPOSE.
  
  See the GNU Affero General Public License for more details.
  You should have received a copy of the
  GNU Affero General Public License along with this program (file "COPYING").
  If not, see <http://www.gnu.org/licenses/>.
  """
  
  from .. import system_tests_common as Common
  from arakoon.ArakoonExceptions import *
  import arakoon
  import logging
  import time
  import subprocess
  from threading import Thread
  from nose.tools import *
  
  
  @Common.with_custom_setup(Common.setup_2_nodes, Common.basic_teardown)
  def test_collapse():
      zero = Common.node_names[0]
      one = Common.node_names[1]
      n = 298765
      Common.iterate_n_times(n, Common.simple_set)
      logging.info("did %i sets, now going into collapse scenario" % n)
      Common.collapse(zero,1)
      logging.info("collapsing done")
      Common.stopOne(one)
      Common.wipe(one)
      Common.startOne(one)
      cli = Common.get_client()
      assert_false(cli.expectProgressPossible())
      up2date = False
      counter = 0
      while not up2date and counter < 100:
          time.sleep(1.0)
          counter = counter + 1
          up2date = cli.expectProgressPossible()
      logging.info("catchup from collapsed node finished")
  
new_contents: """
  This file is part of Arakoon, a distributed key-value store. Copyright
  (C) 2010 Incubaid BVBA
  
  Licensees holding a valid Incubaid license may use this file in
  accordance with Incubaid's Arakoon commercial license agreement. For
  more information on how to enter into this agreement, please contact
  Incubaid (contact details can be found on www.arakoon.org/licensing).
  
  Alternatively, this file may be redistributed and/or modified under
  the terms of the GNU Affero General Public License version 3, as
  published by the Free Software Foundation. Under this license, this
  file is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  nFITNESS FOR A PARTICULAR PURPOSE.
  
  See the GNU Affero General Public License for more details.
  You should have received a copy of the
  GNU Affero General Public License along with this program (file "COPYING").
  If not, see <http://www.gnu.org/licenses/>.
  """
  
  from .. import system_tests_common as Common
  from arakoon.ArakoonExceptions import *
  import arakoon
  import logging
  import time
  import subprocess
  from threading import Thread
  from nose.tools import *
  
  
  @Common.with_custom_setup(Common.setup_2_nodes_forced_master, Common.basic_teardown)
  def test_collapse_forced_slave():
      master = Common.node_names[0]
      forced_slave = Common.node_names[1]
      n = 298765
      Common.iterate_n_times(n, Common.simple_set)
      logging.info("did %i sets, now going into collapse scenario" % n)
      Common.collapse(forced_slave,1)
      logging.info("collapsing done")
      Common.stopOne(master)
      Common.wipe(master)
      Common.startOne(master)
      cli = Common.get_client()
      assert_false(cli.expectProgressPossible())
      up2date = False
      counter = 0
      while not up2date and counter < 100:
          time.sleep(1.0)
          counter = counter + 1
          up2date = cli.expectProgressPossible()
      logging.info("catchup from collapsed node finished")
  
  @Common.with_custom_setup(Common.setup_2_nodes, Common.basic_teardown)
  def test_collapse():
      zero = Common.node_names[0]
      one = Common.node_names[1]
      n = 298765
      Common.iterate_n_times(n, Common.simple_set)
      logging.info("did %i sets, now going into collapse scenario" % n)
      Common.collapse(zero,1)
      logging.info("collapsing done")
      Common.stopOne(one)
      Common.wipe(one)
      Common.startOne(one)
      cli = Common.get_client()
      assert_false(cli.expectProgressPossible())
      up2date = False
      counter = 0
      while not up2date and counter < 100:
          time.sleep(1.0)
          counter = counter + 1
          up2date = cli.expectProgressPossible()
      logging.info("catchup from collapsed node finished")
  
subject: add test to assert forced_slave can collapse