re-rxjs / react-rxjs

React bindings for RxJS
https://react-rxjs.org
MIT License
549 stars 19 forks source link

test(dom): fix flaky test #124

Closed josepot closed 4 years ago

josepot commented 4 years ago

Once in a blue moon we get a random broken CI build and when I check what's broken I find that the test "batchUpdates prevents unnecessary updates" has received 9 updates rather than 6, when that happens I re-run the CI and then the test passes. I've been thinking about it and I think that I know what's causing that and I think that these changes should stop the flakiness of the test.

Basically, what I think that happens is that in some cases the initial mount takes longer than 250ms and then the subscription happens again, causing an extra-update. Using Subscribe should fix that.

codecov[bot] commented 4 years ago

Codecov Report

Merging #124 into main will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #124   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          365       365           
  Branches        37        37           
=========================================
  Hits           365       365           

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 3c57882...c4022dd. Read the comment docs.