pushtorefresh / storio

Reactive API for SQLiteDatabase and ContentResolver.
Apache License 2.0
2.54k stars 182 forks source link

Fix incorrect test parallelWritesWithoutTransaction. #829

Closed artem-zinnatullin closed 7 years ago

artem-zinnatullin commented 7 years ago

Fixes #826.

TL;TR: test was incorrect, because default PutResolver uses short-term transaction thus StorIO has all rights to merge notifications, so sometimes we've seen flakiness due to notifications merge.

CI was freezing because we were awaiting for wrong amount of notifications without timeout, this PR adds timeout to all tests and RepeatRule to make sure our concurrent tests are good.

Thanks a lot @nikitin-da for his work in #827, those logs really helped to figure out what was wrong!

artem-zinnatullin commented 7 years ago

Ah, didn't update take() properly

codecov-io commented 7 years ago

Codecov Report

Merging #829 into master will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #829      +/-   ##
==========================================
+ Coverage   97.39%   97.41%   +0.01%     
==========================================
  Files          89       91       +2     
  Lines        2692     2707      +15     
  Branches      302      305       +3     
==========================================
+ Hits         2622     2637      +15     
  Misses         38       38              
  Partials       32       32
Impacted Files Coverage Δ
...pushtorefresh/storio2/test/ConcurrencyTesting.java 100% <100%> (ø)
...ava/com/pushtorefresh/storio2/test/RepeatRule.java 100% <100%> (ø)

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 6af1d42...c4415ef. Read the comment docs.

artem-zinnatullin commented 7 years ago

@nikitin-da I'm merging this to unblock other PRs, please feel free to comment, I'll open separate PR to fix your comments if needed!

@geralt-encore thanks for review!

nikitin-da commented 7 years ago

@artem-zinnatullin great work man!