XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
100 stars 55 forks source link

Mark test_hafnian_approx as flaky #287

Closed sduquemesa closed 2 years ago

sduquemesa commented 2 years ago

Context: From #146

Currently, the test_hafnian_approx.py tests sometimes randomly fail. This is specific to the test_rank_one function which calls haf_real with approx=True, which in turn calls the C++ function hafnian_nonneg in libwalrus. hafnian_nonneg uses the std::default_random_engine generator (with no seed) causing the output to be random.

Description of the Change: Mark the conflictive test test_rank_one with the @flaky decorator.

Benefits: Flaky will retry a failing test once and avoid braking the build in case the test randomly fails.

Possible Drawbacks: None.

Related GitHub Issues: resolves #146

codecov[bot] commented 2 years ago

Codecov Report

Merging #287 (630583c) into master (8d2c1c3) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #287   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         1430      1430           
=========================================
  Hits          1430      1430           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8d2c1c3...630583c. Read the comment docs.