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

Side by Side Diff: appengine/tsmon/handler_test.go

Issue 2617903005: Remove dsQueryBatch in favor of ds.Batcher. (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 | « appengine/tsmon/handler.go ('k') | dm/appengine/deps/walk_graph.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 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 tsmon 5 package tsmon
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "net/http" 9 "net/http"
10 "net/http/httptest" 10 "net/http/httptest"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 So(rec.Code, ShouldEqual, http.StatusOK) 133 So(rec.Code, ShouldEqual, http.StatusOK)
134 134
135 i, err := getOrCreateInstanceEntity(c) 135 i, err := getOrCreateInstanceEntity(c)
136 So(err, ShouldBeNil) 136 So(err, ShouldBeNil)
137 So(i.TaskNum, ShouldEqual, 1) 137 So(i.TaskNum, ShouldEqual, 1)
138 }) 138 })
139 139
140 Convey("Expires old instances", t, func() { 140 Convey("Expires old instances", t, func() {
141 c, clock := buildGAETestContext() 141 c, clock := buildGAETestContext()
142 142
143 » » for _, count := range []int{1, housekeepingInstanceBatchSize + 1 } { 143 » » for _, count := range []int{1, ds.Raw(c).Constraints().QueryBatc hSize + 1} {
144 Convey(fmt.Sprintf("Count: %d", count), func() { 144 Convey(fmt.Sprintf("Count: %d", count), func() {
145 insts := make([]*instance, count) 145 insts := make([]*instance, count)
146 keys := make([]*ds.Key, count) 146 keys := make([]*ds.Key, count)
147 for i := 0; i < count; i++ { 147 for i := 0; i < count; i++ {
148 insts[i] = &instance{ 148 insts[i] = &instance{
149 ID: fmt.Sprintf("foobar _%d", i), 149 ID: fmt.Sprintf("foobar _%d", i),
150 TaskNum: i, 150 TaskNum: i,
151 LastUpdated: clock.Now(), 151 LastUpdated: clock.Now(),
152 } 152 }
153 keys[i] = ds.KeyForObj(c, insts[i]) 153 keys[i] = ds.KeyForObj(c, insts[i])
(...skipping 14 matching lines...) Expand all
168 }) 168 })
169 So(rec.Code, ShouldEqual, http.StatusOK) 169 So(rec.Code, ShouldEqual, http.StatusOK)
170 170
171 exists, err = ds.Exists(c, keys) 171 exists, err = ds.Exists(c, keys)
172 So(err, ShouldBeNil) 172 So(err, ShouldBeNil)
173 So(exists.Any(), ShouldBeFalse) 173 So(exists.Any(), ShouldBeFalse)
174 }) 174 })
175 } 175 }
176 }) 176 })
177 } 177 }
OLDNEW
« no previous file with comments | « appengine/tsmon/handler.go ('k') | dm/appengine/deps/walk_graph.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698