Exemple #1
0
def runTest(port):
    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')
    channel = makeUniqueString()

    for i in range(5):
        healthCheck(url, role, secret, channel)
Exemple #2
0
def test_health_check(runner):
    '''Starts a server, then run a health check'''
    port = runner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')
    channel = makeUniqueString()

    healthCheck(url, role, secret, channel, retry=False, httpCheck=False)
Exemple #3
0
def test_publish(runner):
    port = runner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')

    creds = createCredentials(role, secret)
    connection = Connection(url, creds)

    asyncio.get_event_loop().run_until_complete(clientCoroutine(connection))
Exemple #4
0
def test_health_check_with_no_redis(redisDownRunner):
    '''Starts a server, then run a health check'''
    port = redisDownRunner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')
    channel = makeUniqueString()

    with pytest.raises(ActionException):
        healthCheck(url, role, secret, channel)
Exemple #5
0
def test_server_again(debugMemoryRunner):
    '''This make sure that we cleanup our server properly,
    and to run the debugMemory code
    '''
    port = debugMemoryRunner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')
    channel = makeUniqueString()

    healthCheck(url, role, secret, channel)
Exemple #6
0
def test_server(runner):
    '''Starts a server, then run a health check'''
    port = runner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')
    channel = makeUniqueString()

    # Run 2 health-checks in a row
    healthCheck(url, role, secret, channel)
    healthCheck(url, role, secret, channel)
Exemple #7
0
def test_admin_disconnect_one(runner):
    '''Starts a server, then run a health check'''
    port = runner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')

    creds = createCredentials(role, secret)
    connection = Connection(url, creds)
    connectionToBeClosed = Connection(url, creds)

    asyncio.get_event_loop().run_until_complete(
        clientCoroutine(connection, connectionToBeClosed))
def test_save_position(runner):
    '''Starts a server, then run a health check'''
    port = runner.port

    url = getDefaultHealthCheckUrl(None, port)
    role = getDefaultRoleForApp('health')
    secret = getDefaultSecretForApp('health')

    creds = createCredentials(role, secret)
    connection = Connection(url, creds)
    _ = Connection(url, creds)

    uniqueId = uuid.uuid4().hex[:8]
    channel = 'test_save_position_channel::' + uniqueId
    resumeFromLastPositionId = 'last_position_id::' + uniqueId

    asyncio.get_event_loop().run_until_complete(
        clientCoroutine(connection, channel, url, creds,
                        resumeFromLastPositionId))