Exemple #1
0
def test_reload_no_forking(pysoa_client):
    print(get_container_process_list('meta_service'))

    assert read_file_from_container('meta_service', '/srv/meta/meta_service/version.py') == "__version__ = '2.1.7'"

    write_file_to_container('meta_service', '/srv/meta/meta_service/version.py', "__version__ = '7.1.2'")
    assert read_file_from_container('meta_service', '/srv/meta/meta_service/version.py') == "__version__ = '7.1.2'"
    time.sleep(10)

    print(get_container_process_list('meta_service'))

    response = pysoa_client.call_action('meta', 'status')
    assert response.body['version'] == '7.1.2'
Exemple #2
0
def test_no_reload_no_watcher():
    print(get_container_process_list('user_service'))

    assert read_file_from_container(
        'user_service',
        '/srv/user/user_service/version.py') == "__version__ = '1.0.17'"

    write_file_to_container('user_service',
                            '/srv/user/user_service/version.py',
                            "__version__ = '1.2.1'")
    assert read_file_from_container(
        'user_service',
        '/srv/user/user_service/version.py') == "__version__ = '1.2.1'"
    time.sleep(10)

    print(get_container_process_list('user_service'))

    responses = pysoa_client.call_actions_parallel(
        'user',
        [
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
        ],
    )
    for response in responses:
        assert response.body['version'] == '1.0.17'
Exemple #3
0
def test_reload_with_forking():
    print(get_container_process_list('echo_service'))

    assert read_file_from_container(
        'echo_service',
        '/srv/echo/echo_service/version.py') == "__version__ = '9.5.3'"

    write_file_to_container('echo_service',
                            '/srv/echo/echo_service/version.py',
                            "__version__ = '9.8.0'")
    assert read_file_from_container(
        'echo_service',
        '/srv/echo/echo_service/version.py') == "__version__ = '9.8.0'"
    time.sleep(10)

    print(get_container_process_list('echo_service'))

    responses = pysoa_client.call_actions_parallel(
        'echo',
        [
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
            {
                'action': 'status'
            },
        ],
    )
    for response in responses:
        assert response.body['version'] == '9.8.0'