Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: common/data/treapstore/store_test.go

Issue 2613153007: Fix race in treapstore test. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/data/treapstore/store_test.go
diff --git a/common/data/treapstore/store_test.go b/common/data/treapstore/store_test.go
index 91a344058dc5bcf4ea8bfcb9e9c0300d271aa4c9..075470b8b233633dc78aa26bcd828c698f2c2989 100644
--- a/common/data/treapstore/store_test.go
+++ b/common/data/treapstore/store_test.go
@@ -260,7 +260,15 @@ func TestStoreParallel(t *testing.T) {
}()
<-writeDoneC
- So(<-readDoneC, ShouldBeGreaterThan, 0)
+
+ check := ShouldBeGreaterThan
+ if i == 0 {
+ // The first time around, we *could* read before anything has been
+ // written. Every other time, something from the previous round will
+ // have been written.
+ check = ShouldBeGreaterThanOrEqualTo
+ }
+ So(<-readDoneC, check, 0)
snaps = append(snaps, head.Snapshot())
}
})
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698