Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_multiple_col_ensure.py is stochastic #100

Open
riastradh-probcomp opened this issue May 5, 2016 · 0 comments
Open

test_multiple_col_ensure.py is stochastic #100

riastradh-probcomp opened this issue May 5, 2016 · 0 comments

Comments

@riastradh-probcomp
Copy link
Contributor

This failure should not be stochastic because we fixed the seed. But sometimes it fails like this:

=================================== FAILURES ===================================
_________________ test_multiple_col_ensure[130223-False-True] __________________

seed = 130223, dependent = False, analyze = True

@pytest.mark.parametrize("seed, dependent, analyze", single_args)
def test_multiple_col_ensure(seed, dependent, analyze):
    rng = random.Random(seed)
    T, M_r, M_c, X_L, X_D, engine = quick_le(get_next_seed(rng))
    col_pairs = [(c1, c2,) for c1, c2 in it.combinations(range(N_COLS), 2)]
    ensure_pairs = random.sample(col_pairs, 4)
    dep_constraints = [(c1, c2, dependent) for c1, c2 in ensure_pairs]

    X_L, X_D = engine.ensure_col_dep_constraints(M_c, M_r, T, X_L, X_D,
    dep_constraints, get_next_seed(rng))

    for col1, col2, dep in dep_constraints:
    assert engine.assert_col_dep_constraints(X_L, X_D, col1, col2, dep, True)

    if analyze:
    X_L, X_D = engine.analyze(M_c, T, X_L, X_D, get_next_seed(rng),
        n_steps=1000)

    for col1, col2, dep in dep_constraints:
>               assert engine.assert_col_dep_constraints(X_L, X_D, col1, col2, dep, True)
E               assert <bound method LocalEngine.assert_col_dep_constraints of <crosscat.LocalEngine.LocalEngine object at 0x7fc498d4f210>>({'col_ensure': {'dependent': {}, 'independent': {'1': [9], '2': [5], '3': [6], '5': [2], ...}}, 'column_hypers': [{'fi... 'column_names': [5, 6, 7, 8, 9], 'row_partition_model': {'counts': [5, 5], 'hypers': {'alpha': 0.2511886431509581}}}]}, [[0, 1, 1, 0, 0, 0, ...], [0, 1, 1, 1, 1, 0, ...]], 6, 9, False, True)
E                +  where <bound method LocalEngine.assert_col_dep_constraints of <crosscat.LocalEngine.LocalEngine object at 0x7fc498d4f210>> = <crosscat.LocalEngine.LocalEngine object at 0x7fc498d4f210>.assert_col_dep_constraints

src/tests/unit_tests/test_col_ensure.py:123: AssertionError
===Flaky Test Report===
@gregory-marton gregory-marton changed the title test_col_ensure.py is stochastic test_multiple_col_ensure.py is stochastic May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant