def test_old_tasks_get_relaunched_with_new_config():
    hello_task_id = sdk_tasks.get_task_ids(config.SERVICE_NAME, "hello")
    assert len(hello_task_id) > 0, "Got an empty list of task_ids"
    # Start update plan with options that have list of yaml files to make it
    # launch in multi service mode with updated config
    sdk_upgrade.update_or_upgrade_or_downgrade(
        config.PACKAGE_NAME,
        config.SERVICE_NAME,
        to_version=None,
        to_options={
            "service": {
                "yaml": "",
                "yamls": "svc,foobar_service_name"
            },
            "hello": {
                "cpus": 0.2
            },
        },
        expected_running_tasks=4,
        wait_for_deployment=False,
    )
    # Ensure the old task DOES relaunch
    sdk_plan.wait_for_completed_deployment(config.SERVICE_NAME,
                                           multiservice_name="foobar")
    sdk_tasks.check_task_relaunched("hello-0-server", hello_task_id.pop())
    assert len(sdk_tasks.get_task_ids(config.SERVICE_NAME, "foo")) == 1
Exemplo n.º 2
0
def test_finish_task_restarts_on_config_update():
    foldered_name = sdk_utils.get_foldered_name(config.SERVICE_NAME)
    config.check_running(foldered_name)
    task_name = "world-0-finish"
    world_finish_id = get_completed_task_id(task_name)
    assert world_finish_id is not None
    log.info("%s ID: %s", task_name, world_finish_id)
    config.bump_world_cpus(foldered_name)

    sdk_tasks.check_task_relaunched(task_name, world_finish_id, ensure_new_task_not_completed=False)
    config.check_running(foldered_name)
def test_finish_task_restarts_on_config_update():
    foldered_name = sdk_utils.get_foldered_name(config.SERVICE_NAME)
    config.check_running(foldered_name)
    task_name = 'world-0-finish'
    world_finish_id = sdk_tasks.get_completed_task_id(task_name)
    assert world_finish_id is not None
    log.info('world_finish_id: ' + str(world_finish_id))

    updated_cpus = config.bump_world_cpus(foldered_name)

    sdk_tasks.check_task_relaunched(task_name, world_finish_id)
    config.check_running(foldered_name)
Exemplo n.º 4
0
def test_finish_task_restarts_on_config_update():
    foldered_name = sdk_utils.get_foldered_name(config.SERVICE_NAME)
    config.check_running(foldered_name)
    task_name = 'world-0-finish'
    world_finish_id = sdk_tasks.get_completed_task_id(task_name)
    assert world_finish_id is not None
    log.info('world_finish_id: ' + str(world_finish_id))

    updated_cpus = config.bump_world_cpus(foldered_name)

    sdk_tasks.check_task_relaunched(task_name, world_finish_id)
    config.check_running(foldered_name)
def test_finish_task_restarts_on_config_update():
    foldered_name = sdk_utils.get_foldered_name(config.SERVICE_NAME)
    config.check_running(foldered_name)
    task_name = "world-0-finish"
    world_finish_id = get_completed_task_id(task_name)
    assert world_finish_id is not None
    log.info("%s ID: %s", task_name, world_finish_id)
    config.bump_world_cpus(foldered_name)

    sdk_tasks.check_task_relaunched(task_name,
                                    world_finish_id,
                                    ensure_new_task_not_completed=False)
    config.check_running(foldered_name)
def test_old_tasks_get_relaunched_with_new_config():
    hello_task_id = sdk_tasks.get_task_ids(config.SERVICE_NAME, 'hello')
    assert len(hello_task_id) > 0, 'Got an empty list of task_ids'
    # Start update plan with options that have list of yaml files to make it
    # launch in multi service mode with updated config
    sdk_upgrade.update_service(config.PACKAGE_NAME,
                               config.SERVICE_NAME,
                               additional_options={
                                   "service": {
                                       "yaml": "",
                                       "yamls": "svc,foobar_service_name"
                                   },
                                   "hello": {
                                       "cpus": 0.2
                                   }
                               })
    # Ensure the old task DOES relaunch
    sdk_plan.wait_for_completed_deployment(config.SERVICE_NAME, multiservice_name='foobar')
    sdk_tasks.check_task_relaunched('hello-0-server', hello_task_id.pop())
    assert len(sdk_tasks.get_task_ids(config.SERVICE_NAME, 'foo')) == 1