vektah / dataloaden

go generate based DataLoader
MIT License
528 stars 79 forks source link

Attempt to fix test flakiness #41

Open edsrzf opened 5 years ago

edsrzf commented 5 years ago

The tests would sometimes fail when run in parallel. (See #39.)

We'd make the following loads (each line in a subtest):

1
10
2 10 20 4
5 50

We use batch size 5. The second and third group both load the key 10. We'll always fetch 2 batches and the first has size 5, but the second will have either size 2 or 3 depending on how the tests run. If the second and third group end up in the same batch, we'll get size 2. Otherwise we'll get size 3. However, we assert that the size is always 3.

I solved the problem by changing the 10 in the third group to 30. Now the size of the second batch is always 3.

codecov[bot] commented 5 years ago

Codecov Report

Merging #41 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #41   +/-   ##
=======================================
  Coverage   85.57%   85.57%           
=======================================
  Files           2        2           
  Lines         104      104           
=======================================
  Hits           89       89           
  Misses         15       15

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 9d6b85c...9f96c02. Read the comment docs.