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

Unified Diff: go/src/infra/gae/libs/memlock/memlock_test.go

Issue 1227203004: Convert 'Testable' interface into an optional filter. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@add_filters
Patch Set: final rebase Created 5 years, 5 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 | « go/src/infra/gae/libs/gae/testable.go ('k') | go/src/infra/gae/libs/meta/eg_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/memlock/memlock_test.go
diff --git a/go/src/infra/gae/libs/memlock/memlock_test.go b/go/src/infra/gae/libs/memlock/memlock_test.go
index ab4fecac94b38a8135e614c80362bef8e7af8b6b..e6de4fb4b1a56eb81bda9c46d09d5d906df3cee0 100644
--- a/go/src/infra/gae/libs/memlock/memlock_test.go
+++ b/go/src/infra/gae/libs/memlock/memlock_test.go
@@ -11,6 +11,7 @@ import (
"time"
"infra/gae/libs/gae"
+ "infra/gae/libs/gae/filters/featureBreaker"
"infra/gae/libs/gae/memory"
"github.com/luci/luci-go/common/clock"
@@ -40,14 +41,11 @@ func TestSimple(t *testing.T) {
default:
}
})
- ctx = memory.Use(ctx)
- mc := gae.GetMC(ctx).(interface {
- gae.Testable
- gae.Memcache
- })
+ ctx, fb := featureBreaker.FilterMC(memory.Use(ctx), nil)
+ mc := gae.GetMC(ctx)
Convey("fails to acquire when memcache is down", func() {
- mc.BreakFeatures(nil, "Add")
+ fb.BreakFeatures(nil, "Add")
err := TryWithLock(ctx, "testkey", "id", func(check func() bool) error {
// should never reach here
So(false, ShouldBeTrue)
@@ -109,7 +107,7 @@ func TestSimple(t *testing.T) {
})
Convey("or because of service issues", func() {
- mc.BreakFeatures(nil, "CompareAndSwap")
+ fb.BreakFeatures(nil, "CompareAndSwap")
waitFalse()
})
})
« no previous file with comments | « go/src/infra/gae/libs/gae/testable.go ('k') | go/src/infra/gae/libs/meta/eg_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698