[gold] Don't cache the ReadOnly expectations
ReadOnly means they aren't being written to (as on skiacorrectness), so
they should be fetched every time.
Bug: 990147
Change-Id: I3d96ba8a5c41a2babcbff06e18dafcdee269e8ab
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/234120
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
diff --git a/golden/go/expstorage/fs_expstore/fs_expstore.go b/golden/go/expstorage/fs_expstore/fs_expstore.go
index fcbc06b..599ba49 100644
--- a/golden/go/expstorage/fs_expstore/fs_expstore.go
+++ b/golden/go/expstorage/fs_expstore/fs_expstore.go
@@ -173,7 +173,7 @@
// getMasterExpectations returns an Expectations object which is safe to mutate
// based on the current state. It is expected the caller has taken care of any mutex grabbing.
func (f *Store) getMasterExpectations() (types.Expectations, error) {
- if f.cache == nil {
+ if f.mode == ReadOnly || f.cache == nil {
c, err := f.loadExpectationsSharded(types.MasterBranch, masterShards)
if err != nil {
return nil, skerr.Fmt("could not load master expectations from firestore: %s", err)