def test_marathon_master_partition_leader_change(marathon_service_name): original_leader = common.get_marathon_leader_not_on_master_leader_node() # blocking outbound connection to mesos master with shakedown.iptable_rules(original_leader): block_port(original_leader, 5050, direction='OUTPUT') # time of the master block time.sleep(timedelta(minutes=1.5).total_seconds()) common.wait_for_marathon_up() current_leader = shakedown.marathon_leader_ip() assert original_leader != current_leader
def test_marathon_zk_partition_leader_change(marathon_service_name): original_leader = common.get_marathon_leader_not_on_master_leader_node() # blocking zk on marathon leader (not master leader) with shakedown.iptable_rules(original_leader): block_port(original_leader, 2181, direction='INPUT') block_port(original_leader, 2181, direction='OUTPUT') # time of the zk block time.sleep(5) common.wait_for_marathon_up() current_leader = shakedown.marathon_leader_ip() assert original_leader != current_leader
def test_marathon_delete_leader(marathon_service_name): original_leader = shakedown.marathon_leader_ip() print('leader: {}'.format(original_leader)) common.delete_marathon_path('v2/leader') common.wait_for_marathon_up() @retrying.retry(stop_max_attempt_number=30) def marathon_leadership_changed(): current_leader = shakedown.marathon_leader_ip() print('leader: {}'.format(current_leader)) assert original_leader != current_leader marathon_leadership_changed()
def setup_module(module): common.ensure_mom() common.wait_for_marathon_up('marathon-user') common.cluster_info() with shakedown.marathon_on_marathon(): clear_marathon()