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

Unified Diff: filter/txnBuf/race_test.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Created 4 years, 4 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
Index: filter/txnBuf/race_test.go
diff --git a/filter/txnBuf/race_test.go b/filter/txnBuf/race_test.go
index c1d60f004d68e3914575f5e89808deac7f043885..32d7a824dd73d2cc9176d376ba17ae0dc65811fc 100644
--- a/filter/txnBuf/race_test.go
+++ b/filter/txnBuf/race_test.go
@@ -9,7 +9,7 @@ import (
"testing"
"github.com/luci/gae/impl/memory"
- "github.com/luci/gae/service/datastore"
+ ds "github.com/luci/gae/service/datastore"
"golang.org/x/net/context"
)
@@ -23,7 +23,6 @@ func TestRace(t *testing.T) {
t.Parallel()
c := FilterRDS(memory.Use(context.Background()))
- ds := datastore.Get(c)
wg := sync.WaitGroup{}
for i := 0; i < 100; i++ {
@@ -32,19 +31,15 @@ func TestRace(t *testing.T) {
wg.Add(1)
go func() {
defer wg.Done()
- err := ds.RunInTransaction(func(c context.Context) error {
- ds := datastore.Get(c)
-
+ err := ds.RunInTransaction(c, func(c context.Context) error {
for i := 0; i < 100; i++ {
- err := ds.RunInTransaction(func(c context.Context) error {
- ds := datastore.Get(c)
-
+ err := ds.RunInTransaction(c, func(c context.Context) error {
ctr := &Counter{ID: id}
- if err := ds.Get(ctr); err != nil && err != datastore.ErrNoSuchEntity {
+ if err := ds.Get(c, ctr); err != nil && err != ds.ErrNoSuchEntity {
t.Fatal("bad Get", err)
}
ctr.Value++
- return ds.Put(ctr)
+ return ds.Put(c, ctr)
}, nil)
if err != nil {
t.Fatal("bad inner RIT", err)

Powered by Google App Engine
This is Rietveld 408576698