Beispiel #1
0
def test_gather_from_workers_permissive(s, a, b):
    a.update_data(data={'x': 1})
    with pytest.raises(KeyError):
        yield gather_from_workers({'x': [a.address], 'y': [b.address]})

    data, bad = yield gather_from_workers({'x': [a.address], 'y': [b.address]},
                                          permissive=True)

    assert data == {'x': 1}
    assert list(bad) == ['y']
Beispiel #2
0
def test_gather_from_workers_permissive(s, a, b):
    a.update_data(data={'x': 1})
    with pytest.raises(KeyError):
        yield gather_from_workers({'x': [a.address], 'y': [b.address]})

    data, bad = yield gather_from_workers({
        'x': [a.address],
        'y': [b.address]
    },
                                          permissive=True)

    assert data == {'x': 1}
    assert list(bad) == ['y']
def test_gather_from_workers_permissive(s, a, b):
    while not a.batched_stream:
        yield gen.sleep(0.01)
    a.update_data(data={'x': 1})
    with pytest.raises(KeyError):
        yield gather_from_workers({'x': [a.address], 'y': [b.address]})

    data, bad = yield gather_from_workers({
        'x': [a.address],
        'y': [b.address]
    },
                                          permissive=True)

    assert data == {'x': 1}
    assert list(bad) == ['y']
Beispiel #4
0
def test_gather_from_workers_permissive(c, s, a, b):
    x = yield c.scatter({'x': 1}, workers=a.address)

    data, missing, bad_workers = yield gather_from_workers(
        {'x': [a.address], 'y': [b.address]}, rpc=rpc)

    assert data == {'x': 1}
    assert list(missing) == ['y']
Beispiel #5
0
def test_gather_from_workers_permissive_flaky(c, s, a, b):
    x = yield c.scatter({"x": 1}, workers=a.address)

    rpc = BrokenConnectionPool()
    data, missing, bad_workers = yield gather_from_workers({"x": [a.address]}, rpc=rpc)

    assert missing == {"x": [a.address]}
    assert bad_workers == [a.address]
Beispiel #6
0
def test_gather_from_workers_permissive(s, a, b):
    while not a.batched_stream:
        yield gen.sleep(0.01)
    a.update_data(data={'x': 1})

    data, missing, bad_workers = yield gather_from_workers(
            {'x': [a.address], 'y': [b.address]})

    assert data == {'x': 1}
    assert list(missing) == ['y']
Beispiel #7
0
def test_gather_from_workers_permissive(c, s, a, b):
    rpc = ConnectionPool()
    x = yield c.scatter({"x": 1}, workers=a.address)

    data, missing, bad_workers = yield gather_from_workers(
        {"x": [a.address], "y": [b.address]}, rpc=rpc
    )

    assert data == {"x": 1}
    assert list(missing) == ["y"]