From deeba00943f5546c2dd9cc862355dee0621f5724 Mon Sep 17 00:00:00 2001 From: Jake Lee Date: Wed, 3 Apr 2019 09:55:25 +0800 Subject: [PATCH] Fix flaky test poisson generator & test_negative_binomial_generator (#14571) * set success_rate to 0.2 * fix the flaky test * reenable the test --- python/mxnet/test_utils.py | 2 +- tests/python/unittest/test_random.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/python/mxnet/test_utils.py b/python/mxnet/test_utils.py index 6d1749b1a611..bbb12dd5d7af 100644 --- a/python/mxnet/test_utils.py +++ b/python/mxnet/test_utils.py @@ -1926,7 +1926,7 @@ def chi_square_check(generator, buckets, probs, nsamples=1000000): _, p = ss.chisquare(f_obs=obs_freq, f_exp=expected_freq) return p, obs_freq, expected_freq -def verify_generator(generator, buckets, probs, nsamples=1000000, nrepeat=5, success_rate=0.25, alpha=0.05): +def verify_generator(generator, buckets, probs, nsamples=1000000, nrepeat=5, success_rate=0.2, alpha=0.05): """Verify whether the generator is correct using chi-square testing. The test is repeated for "nrepeat" times and we check if the success rate is diff --git a/tests/python/unittest/test_random.py b/tests/python/unittest/test_random.py index c3eebcf27922..8fbd97d8a162 100644 --- a/tests/python/unittest/test_random.py +++ b/tests/python/unittest/test_random.py @@ -568,7 +568,6 @@ def test_exponential_generator(): for _ in range(10)]) verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs, success_rate=0.20) -@unittest.skip("Flaky test. Tracked in https://github.com/apache/incubator-mxnet/issues/13584") @with_seed() def test_poisson_generator(): ctx = mx.context.current_context() @@ -584,7 +583,6 @@ def test_poisson_generator(): for _ in range(10)]) verify_generator(generator=generator_mx_same_seed, buckets=buckets, probs=probs) -@unittest.skip("Flaky test. Tracked in https://github.com/apache/incubator-mxnet/issues/13506") @with_seed() def test_negative_binomial_generator(): ctx = mx.context.current_context()