Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Fix flaky model replication test #8

Closed
meissnereric opened this issue Sep 12, 2018 · 2 comments
Closed

Fix flaky model replication test #8

meissnereric opened this issue Sep 12, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@meissnereric
Copy link
Contributor

The test that fails sometimes is:

testing/core/factor_graph_test.py::FactorGraphTests::test_replicate_simple_model

It only fails on Linux builds and only occasionally. First step would be to reproduce the failure then debug why it's happening.

@meissnereric
Copy link
Contributor Author

============================= test session starts ==============================
platform darwin -- Python 3.4.4, pytest-3.5.1, py-1.6.0, pluggy-0.6.0 -- /Users/travis/.pyenv/versions/3.4.4/bin/python3.4
cachedir: .pytest_cache
rootdir: /Users/travis/build/amzn/MXFusion, inifile: setup.cfg
plugins: cov-2.5.1
collected 100 items
_________________ FactorGraphTests.test_replicate_simple_model _________________
self = <factor_graph_test.FactorGraphTests testMethod=test_replicate_simple_model>
    def test_replicate_simple_model(self):
        m = mf.models.Model(verbose=False)
        m.x = mfc.Variable()
        d = mf.components.distributions.Normal(mean=mx.nd.array([0]), variance=mx.nd.array([1e6]))
        m.x.set_prior(d)
        m2, var_map = m.clone()
        # compare m and m2 components and such for exactness.
        self.assertTrue(all([k.uuid == v.uuid for k, v in var_map.items()]))
        self.assertTrue(all([k.uuid == v.uuid for k, v in
>                       zip(m.components.values(), m2.components.values())]))
E       AssertionError: False is not true
testing/core/factor_graph_test.py:147: AssertionError

@meissnereric
Copy link
Contributor Author

Setting environment variables from .travis.yml
$ export PYTHON=3.4.4

@meissnereric meissnereric added the bug Something isn't working label Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants