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

Unified Diff: cipd/client/cipd/internal/instancecache_test.go

Issue 2872193003: [cipd] delete bad cache files when failing do deploy them. (Closed)
Patch Set: fix things Created 3 years, 7 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 | « cipd/client/cipd/internal/instancecache.go ('k') | cipd/client/cipd/local/fs.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/internal/instancecache_test.go
diff --git a/cipd/client/cipd/internal/instancecache_test.go b/cipd/client/cipd/internal/instancecache_test.go
index 1bd3d534a32e8ce5f0c5b9840b2288a618d77731..79667defda866d0f932d53f5e88cced8fc845309 100644
--- a/cipd/client/cipd/internal/instancecache_test.go
+++ b/cipd/client/cipd/internal/instancecache_test.go
@@ -53,7 +53,7 @@ func TestInstanceCache(t *testing.T) {
buf, err := ioutil.ReadAll(r)
So(err, ShouldBeNil)
So(string(buf), ShouldEqual, data)
- So(r.Close(), ShouldBeNil)
+ So(r.Close(ctx, false), ShouldBeNil)
}
Convey("Works", func() {
@@ -63,7 +63,7 @@ func TestInstanceCache(t *testing.T) {
pin := common.Pin{"pkg", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}
r, err := cache.Get(ctx, pin, now)
So(os.IsNotExist(err), ShouldBeTrue)
- So(r, ShouldBeNil)
+ So(r, ShouldResemble, nil)
// Add new.
put(cache, pin, "blah")
@@ -101,7 +101,7 @@ func TestInstanceCache(t *testing.T) {
for i := 0; i < testInstanceCacheMaxSize*2; i++ {
r, err := cache.Get(ctx, pini(i), now)
if r != nil {
- r.Close()
+ r.Close(ctx, false)
}
So(os.IsNotExist(err), ShouldEqual, i < testInstanceCacheMaxSize)
}
@@ -127,7 +127,7 @@ func TestInstanceCache(t *testing.T) {
for i := 0; i < 8; i++ {
r, _ := cache.Get(ctx, pini(i), now)
if r != nil {
- r.Close()
+ r.Close(ctx, false)
alive = append(alive, i)
}
}
« no previous file with comments | « cipd/client/cipd/internal/instancecache.go ('k') | cipd/client/cipd/local/fs.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698