Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix flaky test poisson generator & test_negative_binomial_generator #14571

Merged
merged 3 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/python/unittest/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down