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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package treapstore 5 package treapstore
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "strconv" 9 "strconv"
10 "strings" 10 "strings"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 go func() { 253 go func() {
254 doWrite(strconv.Itoa(i)) 254 doWrite(strconv.Itoa(i))
255 close(writeDoneC) 255 close(writeDoneC)
256 }() 256 }()
257 // The first round has to actually create the Collection . 257 // The first round has to actually create the Collection .
258 go func() { 258 go func() {
259 readDoneC <- doReads() 259 readDoneC <- doReads()
260 }() 260 }()
261 261
262 <-writeDoneC 262 <-writeDoneC
263 » » » So(<-readDoneC, ShouldBeGreaterThan, 0) 263
264 » » » check := ShouldBeGreaterThan
265 » » » if i == 0 {
266 » » » » // The first time around, we *could* read before anything has been
267 » » » » // written. Every other time, something from the previous round will
268 » » » » // have been written.
269 » » » » check = ShouldBeGreaterThanOrEqualTo
270 » » » }
271 » » » So(<-readDoneC, check, 0)
264 snaps = append(snaps, head.Snapshot()) 272 snaps = append(snaps, head.Snapshot())
265 } 273 }
266 }) 274 })
267 } 275 }
OLDNEW
« 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