def test_service_becomes_healthy_after_agent_is_partitioned():
    host = get_broker_host()

    spin(shakedown.partition_agent, lambda x: (True, ''), host)
    shakedown.reconnect_agent(host)

    check_health()
def test_partition(install_framework):
    host = get_node_host()

    shakedown.partition_agent(host)
    shakedown.reconnect_agent(host)

    check_health()
Ejemplo n.º 3
0
def test_partition(install_framework):
    host = get_node_host()

    shakedown.partition_agent(host)
    shakedown.reconnect_agent(host)

    check_health()
Ejemplo n.º 4
0
def test_service_becomes_healthy_after_agent_is_partitioned():
    host = get_broker_host()

    spin(shakedown.partition_agent, lambda x: (True, ''), host)
    shakedown.reconnect_agent(host)

    check_health()
Ejemplo n.º 5
0
def test_partition():
    host = get_node_host()

    shakedown.partition_agent(host)
    shakedown.reconnect_agent(host)

    check_health()
def test_all_partition():
    hosts = shakedown.get_service_ips(config.SERVICE_NAME)
    for host in hosts:
        shakedown.partition_agent(host)
    for host in hosts:
        shakedown.reconnect_agent(host)
    config.check_running()
def test_service_becomes_healthy_after_all_agents_are_partitioned():
    hosts = shakedown.get_service_ips(PACKAGE_NAME)

    for host in hosts:
        spin(shakedown.partition_agent, lambda x: (True, ''), host)
    for host in hosts:
        shakedown.reconnect_agent(host)

    check_health()
Ejemplo n.º 8
0
def test_service_becomes_healthy_after_all_agents_are_partitioned():
    hosts = shakedown.get_service_ips(PACKAGE_NAME)

    for host in hosts:
        spin(shakedown.partition_agent, lambda x: (True, ''), host)
    for host in hosts:
        shakedown.reconnect_agent(host)

    check_health()
def test_all_partition():
    hosts = shakedown.get_service_ips(PACKAGE_NAME)

    for host in hosts:
        shakedown.partition_agent(host)
    for host in hosts:
        shakedown.reconnect_agent(host)

    check_health()
Ejemplo n.º 10
0
def test_all_partition():
    hosts = shakedown.get_service_ips(PACKAGE_NAME)

    for host in hosts:
        shakedown.partition_agent(host)
    for host in hosts:
        shakedown.reconnect_agent(host)

    check_health()
def test_partition():
    host = get_node_host()

    shakedown.partition_agent(host)
    time.sleep(20)
    shakedown.reconnect_agent(host)
    recover_host_from_partitioning(host)

    check_health()
def test_all_partition():
    hosts = shakedown.get_service_ips(PACKAGE_NAME)

    for host in hosts:
        shakedown.partition_agent(host)
    time.sleep(20)
    for host in hosts:
        shakedown.reconnect_agent(host)
    for host in hosts:
        recover_host_from_partitioning(host)

    check_health()
Ejemplo n.º 13
0
def test_config_update_while_partitioned():
    world_ids = sdk_tasks.get_task_ids(config.SERVICE_NAME, 'world')
    host = sdk_hosts.system_host(config.SERVICE_NAME, "world-0-server")
    shakedown.partition_agent(host)

    service_config = sdk_marathon.get_config(config.SERVICE_NAME)
    updated_cpus = float(service_config['env']['WORLD_CPUS']) + 0.1
    service_config['env']['WORLD_CPUS'] = str(updated_cpus)
    sdk_marathon.update_app(config.SERVICE_NAME, service_config, wait_for_completed_deployment=False)

    shakedown.reconnect_agent(host)
    sdk_tasks.check_tasks_updated(config.SERVICE_NAME, 'world', world_ids)
    config.check_running()
    all_tasks = shakedown.get_service_tasks(config.SERVICE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('world') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == config.world_task_count(config.SERVICE_NAME)
    for t in running_tasks:
        assert config.close_enough(t['resources']['cpus'], updated_cpus)
Ejemplo n.º 14
0
def test_config_update_while_partitioned():
    world_ids = sdk_tasks.get_task_ids(config.SERVICE_NAME, 'world')
    host = sdk_hosts.system_host(config.SERVICE_NAME, "world-0-server")
    shakedown.partition_agent(host)

    service_config = sdk_marathon.get_config(config.SERVICE_NAME)
    updated_cpus = float(service_config['env']['WORLD_CPUS']) + 0.1
    service_config['env']['WORLD_CPUS'] = str(updated_cpus)
    sdk_marathon.update_app(config.SERVICE_NAME, service_config, wait_for_completed_deployment=False)

    shakedown.reconnect_agent(host)
    sdk_tasks.check_tasks_updated(config.SERVICE_NAME, 'world', world_ids)
    config.check_running()
    all_tasks = shakedown.get_service_tasks(config.SERVICE_NAME)
    running_tasks = [t for t in all_tasks if t['name'].startswith('world') and t['state'] == "TASK_RUNNING"]
    assert len(running_tasks) == config.world_task_count(config.SERVICE_NAME)
    for t in running_tasks:
        assert config.close_enough(t['resources']['cpus'], updated_cpus)
Ejemplo n.º 15
0
 def partition():
     for host in hosts:
         spin(shakedown.partition_agent, lambda x: (True, ''), host)
     for host in hosts:
         shakedown.reconnect_agent(host)
Ejemplo n.º 16
0
 def partition():
     for host in hosts:
         shakedown.partition_agent(host)
     for host in hosts:
         shakedown.reconnect_agent(host)
Ejemplo n.º 17
0
 def partition():
     shakedown.partition_agent(host)
     shakedown.reconnect_agent(host)
 def partition():
     shakedown.partition_agent(host)
     time.sleep(20)
     shakedown.reconnect_agent(host)
 def partition():
     for host in hosts:
         shakedown.partition_agent(host)
     for host in hosts:
         shakedown.reconnect_agent(host)
 def partition():
     shakedown.partition_agent(host)
     shakedown.reconnect_agent(host)
 def partition():
     for host in hosts:
         shakedown.partition_agent(host)
     time.sleep(20)
     for host in hosts:
         shakedown.reconnect_agent(host)
Ejemplo n.º 22
0
 def partition():
     for host in hosts:
         spin(shakedown.partition_agent, lambda x: (True, ''), host)
     for host in hosts:
         shakedown.reconnect_agent(host)
def test_partition():
    host = sdk_hosts.system_host(config.SERVICE_NAME, "hello-0-server")
    shakedown.partition_agent(host)
    shakedown.reconnect_agent(host)
    config.check_running()