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

Side by Side Diff: filter/count/count_test.go

Issue 1844183003: Don't filter "Stop" error in raw interface. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Count filter doesn't count Stop as error. Created 4 years, 8 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 | filter/count/rds.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package count 5 package count
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "testing" 9 "testing"
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 fb.UnbreakFeatures("GetMulti") 86 fb.UnbreakFeatures("GetMulti")
87 87
88 So(ds.PutMulti(vals), ShouldBeNil) 88 So(ds.PutMulti(vals), ShouldBeNil)
89 89
90 die(ds.GetMulti(vals)) 90 die(ds.GetMulti(vals))
91 So(ctr.GetMulti.Errors(), ShouldEqual, 1) 91 So(ctr.GetMulti.Errors(), ShouldEqual, 1)
92 So(ctr.GetMulti.Successes(), ShouldEqual, 1) 92 So(ctr.GetMulti.Successes(), ShouldEqual, 1)
93 So(ctr.GetMulti.Total(), ShouldEqual, 2) 93 So(ctr.GetMulti.Total(), ShouldEqual, 2)
94 }) 94 })
95
96 Convey(`datastore.Stop does not count as an error`, func() {
97 fb.BreakFeatures(datastore.Stop, "GetMulti")
98
99 So(ds.GetMulti(vals), ShouldBeNil)
100 So(ctr.GetMulti.Successes(), ShouldEqual, 1)
101 So(ctr.GetMulti.Errors(), ShouldEqual, 0)
102 So(ctr.GetMulti.Total(), ShouldEqual, 1)
103 })
95 }) 104 })
96 105
97 Convey("works for memcache", t, func() { 106 Convey("works for memcache", t, func() {
98 c, ctr := FilterMC(memory.Use(context.Background())) 107 c, ctr := FilterMC(memory.Use(context.Background()))
99 So(c, ShouldNotBeNil) 108 So(c, ShouldNotBeNil)
100 So(ctr, ShouldNotBeNil) 109 So(ctr, ShouldNotBeNil)
101 mc := memcache.Get(c) 110 mc := memcache.Get(c)
102 111
103 die(mc.Set(mc.NewItem("hello").SetValue([]byte("sup")))) 112 die(mc.Set(mc.NewItem("hello").SetValue([]byte("sup"))))
104 113
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 218
210 // Using the other function. 219 // Using the other function.
211 someCalledFunc(c) 220 someCalledFunc(c)
212 someCalledFunc(c) 221 someCalledFunc(c)
213 222
214 // Then we can see what happened! 223 // Then we can see what happened!
215 fmt.Printf("%d\n", counter.PutMulti.Successes()) 224 fmt.Printf("%d\n", counter.PutMulti.Successes())
216 // Output: 225 // Output:
217 // 2 226 // 2
218 } 227 }
OLDNEW
« no previous file with comments | « no previous file | filter/count/rds.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698