Skip to content

Flaky test: test_component_choice_random #6210

@michaelosthege

Description

@michaelosthege

It failed in this run https://github.com/pymc-devs/pymc/actions/runs/3240831110/jobs/5311952415

With

___________________ TestMixture.test_component_choice_random ___________________

self = <pymc.tests.distributions.test_mixture.TestMixture object at 0x7fb12dd6a2f0>

    def test_component_choice_random(self):
        """Test that mixture choices change over evaluations"""
        with Model() as m:
            weights = [0.5, 0.5]
            components = [Normal.dist(-10, 0.01), Normal.dist(10, 0.01)]
            mix = Mixture.dist(weights, components)
        draws = draw(mix, draws=10)
        # Probability of coming from same component 10 times is 0.5**10
>       assert np.unique(draws > 0).size == 2
E       assert 1 == 2
E        +  where 1 = array([False]).size
E        +    where array([False]) = <function unique at 0x7fb14babd360>(array([-10.01041454, -10.00804946, -10.02323384, -10.01368128,\n        -9.99331916,  -9.9980023 ,  -9.98098861, -10.00484836,\n        -9.993316  , -10.00568352]) > 0)
E        +      where <function unique at 0x7fb14babd360> = np.unique

pymc/tests/distributions/test_mixture.py:338: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions