@pytest.mark.slow
def test_set_index_consistent_divisions():
    df = pd.DataFrame({'x': np.random.random(100), 'y': (np.random.random(100) // 0.2)}, index=np.random.random(100))
    ddf = dd.from_pandas(df, npartitions=4)
    ddf = ddf.clear_divisions()
    ctx = mp.get_context('spawn')
    with ProcessPoolExecutor(8, ctx) as pool:
        func = partial(_set_index, df=ddf, idx='x')
        divisions_set = set(pool.map(func, range(100)))
    assert (len(divisions_set) == 1)
@pytest.mark.slow
def test_set_index_consistent_divisions():
    df = pd.DataFrame({'x': np.random.random(100), 'y': (np.random.random(100) // 0.2)}, index=np.random.random(100))
    ddf = dd.from_pandas(df, npartitions=4)
    ddf = ddf.clear_divisions()
    ctx = mp.get_context('spawn')
    with ProcessPoolExecutor(8, ctx) as pool:
        func = partial(_set_index, df=ddf, idx='x')
        divisions_set = set(pool.map(func, range(100)))
    assert (len(divisions_set) == 1)