Esempio n. 1
0
    def f(c, a, b):
        dsk = {'x': 1, 'y': (inc, 'x'), 'z': (inc, 'y')}
        keys = 'z'
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)
        assert result == dask.get(dsk, keys)

        dsk = {'x': 1, 'y': (inc, 'x'), 'z': (inc, 'y'),
               'a': (inc, 'z'), 'b': (add, 'a', 'x')}
        keys = 'b'
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)
        assert result == dask.get(dsk, keys)
Esempio n. 2
0
    def f(c, a, b):
        a.data['y'] = 10                # manually add 'y' to a
        c.who_has['y'].add(a.address)
        c.has_what[a.address].add('y')

        result = yield _get(c.ip, c.port, dsk, keys)
        assert result.key in a.data or result.key in b.data
Esempio n. 3
0
 def f(c, a, b):
     try:
         result = yield _get(c.ip, c.port, dsk, keys)
         assert False
     except ZeroDivisionError as e:
         # assert 'mydiv' in str(e)
         pass
Esempio n. 4
0
    def f(c, a, b):
        a.data['y'] = 10  # manually add 'y' to a
        c.who_has['y'].add(a.address)
        c.has_what[a.address].add('y')

        result = yield _get(c.ip, c.port, dsk, keys)
        assert result.key in a.data or result.key in b.data
Esempio n. 5
0
    def f(c, a, b):
        dsk = {'x': 1, 'y': (inc, 'x'), 'z': (inc, 'y')}
        keys = 'z'
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)
        assert result == dask.get(dsk, keys)

        dsk = {
            'x': 1,
            'y': (inc, 'x'),
            'z': (inc, 'y'),
            'a': (inc, 'z'),
            'b': (add, 'a', 'x')
        }
        keys = 'b'
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)
        assert result == dask.get(dsk, keys)
Esempio n. 6
0
 def f(c, a, b):
     try:
         result = yield _get(c.ip, c.port, dsk, keys)
         assert False
     except ZeroDivisionError as e:
         # assert 'mydiv' in str(e)
         pass
Esempio n. 7
0
    def f(c, a, b):
        a.data['x'] = 10
        c.who_has['x'].add(a.address)
        c.has_what[a.address].add('x')
        x = RemoteData('x', c.ip, c.port)

        dsk = {'y': (inc, x)}

        result = yield _get(c.ip, c.port, dsk, 'y', gather=True)
        assert result == 11
        assert 'x' in a.data  # don't delete input data
Esempio n. 8
0
    def f(c, a, b):
        a.data['x'] = 10
        c.who_has['x'].add(a.address)
        c.has_what[a.address].add('x')
        x = RemoteData('x', c.ip, c.port)

        dsk = {'y': (inc, x)}

        result = yield _get(c.ip, c.port, dsk, 'y', gather=True)
        assert result == 11
        assert 'x' in a.data  # don't delete input data
Esempio n. 9
0
 def f(c, a, b):
     result = yield _get(c.ip, c.port, dsk, keys, gather=True)
     assert result == 2
Esempio n. 10
0
    def f(c, a, b):
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)

        expected = dask.async.get_sync(dsk, keys)
        assert tuple(result) == expected
        assert set(a.data) | set(b.data) == {'total', 'c', 'z'}
Esempio n. 11
0
 def f(c, a, b):
     x = yield _get(c.ip, c.port, dsk, 'x', gather=True)
     y = yield _get(c.ip, c.port, dsk, 'x', gather=True)
     assert x == y
Esempio n. 12
0
 def f():
     result = yield _get('127.0.0.1', c['port'], dsk, keys, gather=True)
     assert result == 96
Esempio n. 13
0
    def f(c, a, b):
        result = yield _get(c.ip, c.port, dsk, keys, gather=True)

        expected = dask. async .get_sync(dsk, keys)
        assert tuple(result) == expected
        assert set(a.data) | set(b.data) == {'total', 'c', 'z'}
Esempio n. 14
0
 def f(c, a, b):
     x = yield _get(c.ip, c.port, dsk, 'x', gather=True)
     y = yield _get(c.ip, c.port, dsk, 'x', gather=True)
     assert x == y
Esempio n. 15
0
 def f():
     result = yield _get('127.0.0.1', c['port'], dsk, keys, gather=True)
     assert result == 96
Esempio n. 16
0
 def f(c, a, b):
     result = yield _get(c.ip, c.port, dsk, keys, gather=True)
     assert result == 2