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

Unified Diff: go/src/infra/gae/libs/gae/memory/memcache_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/memory/memcache.go ('k') | go/src/infra/gae/libs/gae/memory/raw_datstore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/memory/memcache_test.go
diff --git a/go/src/infra/gae/libs/gae/memory/memcache_test.go b/go/src/infra/gae/libs/gae/memory/memcache_test.go
index 0829aa40185f6da07d4d7b1ec71ddfdcaaa19da0..fc36b0f81f1844488c38b8166c402c12a4974825 100644
--- a/go/src/infra/gae/libs/gae/memory/memcache_test.go
+++ b/go/src/infra/gae/libs/gae/memory/memcache_test.go
@@ -23,8 +23,6 @@ func TestMemcache(t *testing.T) {
c, tc := testclock.UseTime(context.Background(), now)
c = Use(c)
mc := gae.GetMC(c)
- mci := gae.GetMC(c).(*memcacheImpl)
- So(mc, ShouldNotEqual, mci) // two impls with the same memcacheData
Convey("implements MCSingleReadWriter", func() {
Convey("Add", func() {
@@ -39,12 +37,6 @@ func TestMemcache(t *testing.T) {
err := mc.Add(itm)
So(err, ShouldEqual, gae.ErrMCNotStored)
})
-
- Convey("which can be broken intentionally", func() {
- mci.BreakFeatures(nil, "Add")
- err := mc.Add(itm)
- So(err, ShouldEqual, gae.ErrMCServerError)
- })
})
Convey("Get", func() {
@@ -71,12 +63,6 @@ func TestMemcache(t *testing.T) {
So(err, ShouldEqual, gae.ErrMCCacheMiss)
So(i, ShouldBeNil)
})
-
- Convey("which can be broken intentionally", func() {
- mci.BreakFeatures(nil, "Get")
- _, err := mc.Get("sup")
- So(err, ShouldEqual, gae.ErrMCServerError)
- })
})
Convey("Delete", func() {
@@ -101,12 +87,6 @@ func TestMemcache(t *testing.T) {
err := mc.Delete("sup")
So(err, ShouldEqual, gae.ErrMCCacheMiss)
})
-
- Convey("and can be broken", func() {
- mci.BreakFeatures(nil, "Delete")
- err := mc.Delete("sup")
- So(err, ShouldEqual, gae.ErrMCServerError)
- })
})
Convey("Set", func() {
@@ -130,12 +110,6 @@ func TestMemcache(t *testing.T) {
i, err := mc.Get("sup")
So(err, ShouldBeNil)
So(i, ShouldResemble, testItem)
-
- Convey("and can be broken", func() {
- mci.BreakFeatures(nil, "Set")
- err := mc.Set(itm)
- So(err, ShouldEqual, gae.ErrMCServerError)
- })
})
Convey("CompareAndSwap", func() {
@@ -169,12 +143,6 @@ func TestMemcache(t *testing.T) {
err = mc.CompareAndSwap(itm)
So(err, ShouldEqual, gae.ErrMCNotStored)
})
-
- Convey("and can be broken", func() {
- mci.BreakFeatures(nil, "CompareAndSwap")
- err = mc.CompareAndSwap(itm)
- So(err, ShouldEqual, gae.ErrMCServerError)
- })
})
})
@@ -186,6 +154,8 @@ func TestMemcache(t *testing.T) {
expiration: time.Second * 2,
})
+ mci := mc.(*memcacheImpl)
+
So(err, ShouldBeNil)
So(len(mci.data.items), ShouldEqual, 1)
So(mci.data.casID, ShouldEqual, 1)
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/memcache.go ('k') | go/src/infra/gae/libs/gae/memory/raw_datstore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698