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

Commit

Permalink
Fix flaky test poisson generator & test_negative_binomial_generator (#…
Browse files Browse the repository at this point in the history
…14571)

* set success_rate to 0.2

* fix the flaky test

* reenable the test
  • Loading branch information
stu1130 authored and szha committed Apr 3, 2019
1 parent 214ce63 commit a6fd0e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
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

0 comments on commit a6fd0e9

Please sign in to comment.