Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky TestTruncation.truncation_discrete_random #6229

Merged

Conversation

mattiadg
Copy link
Contributor

@mattiadg mattiadg commented Oct 18, 2022

Closes #6206

  • Add seed to rejection test
  • Add a comment about the test probability

What is this PR about?
Fix Potential flaky test: truncation_discrete_random
I add a seed to the test part that can fail stochastically.

Checklist

Major / Breaking Changes

  • ...

Bugfixes / New features

  • ...

Docs / Maintenance

  • Fix flaky TestTruncation.truncation_discrete_random

pymc-devs#6206
* Add seed to rejection test
* Add a comment about the test probability
Pass a random seed to draw() for deterministic result instead of a np.random.RandomState

Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #6229 (f97df7c) into main (7503730) will decrease coverage by 2.82%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6229      +/-   ##
==========================================
- Coverage   93.61%   90.79%   -2.83%     
==========================================
  Files         101      101              
  Lines       22120    22129       +9     
==========================================
- Hits        20707    20091     -616     
- Misses       1413     2038     +625     
Impacted Files Coverage Δ
pymc/tests/distributions/test_truncated.py 99.48% <100.00%> (ø)
pymc/tests/step_methods/test_slicer.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/step_methods/hmc/test_nuts.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/step_methods/test_metropolis.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/step_methods/metropolis.py 54.56% <0.00%> (-28.84%) ⬇️
pymc/sampling.py 71.22% <0.00%> (-11.41%) ⬇️
pymc/backends/report.py 90.00% <0.00%> (-10.00%) ⬇️
pymc/step_methods/arraystep.py 89.36% <0.00%> (-4.97%) ⬇️
pymc/backends/base.py 86.34% <0.00%> (-1.61%) ⬇️
pymc/tests/backends/test_arviz.py 99.02% <0.00%> (+0.01%) ⬆️
... and 2 more

@ricardoV94 ricardoV94 changed the title Fix Potential flaky test: truncation_discrete_random Fix flaky TestTruncation.truncation_discrete_random Oct 24, 2022
@ricardoV94 ricardoV94 merged commit ce89404 into pymc-devs:main Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential flaky test: truncation_discrete_random
2 participants