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

Side by Side Diff: fuzzer/go/frontend/syncer/fuzz_syncer.go

Issue 1672033002: Deduplicate fuzz cases on the frontend before they are displayed. (Closed) Base URL: https://skia.googlesource.com/buildbot@remove-overview
Patch Set: merged upstream Created 4 years, 10 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 | « fuzzer/go/frontend/gsloader/gsloader.go ('k') | fuzzer/go/fuzzcache/fuzzcache_test.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 package syncer 1 package syncer
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "sort" 5 "sort"
6 "strings" 6 "strings"
7 "sync" 7 "sync"
8 "time" 8 "time"
9 9
10 "github.com/skia-dev/glog" 10 "github.com/skia-dev/glog"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return "", err 125 return "", err
126 } 126 }
127 glog.Infof("Most recent old version found to be %s", newestHash) 127 glog.Infof("Most recent old version found to be %s", newestHash)
128 return newestHash, nil 128 return newestHash, nil
129 } 129 }
130 130
131 // updateLoadedBinaryFuzzes uses gsLoader to download the fuzzes that are curren tly not 131 // updateLoadedBinaryFuzzes uses gsLoader to download the fuzzes that are curren tly not
132 // in the fuzz report tree / cache. 132 // in the fuzz report tree / cache.
133 func (f *FuzzSyncer) updateLoadedBinaryFuzzes(currentBadFuzzHashes []string) err or { 133 func (f *FuzzSyncer) updateLoadedBinaryFuzzes(currentBadFuzzHashes []string) err or {
134 if f.gsLoader == nil { 134 if f.gsLoader == nil {
135 » » glog.Info("Skipping update because the finder/cache hasn't been set yet") 135 » » glog.Info("Skipping update because the cache hasn't been set yet ")
136 return nil 136 return nil
137 } 137 }
138 prevBadFuzzNames, err := f.gsLoader.Cache.LoadFuzzNames(config.FrontEnd. SkiaVersion.Hash) 138 prevBadFuzzNames, err := f.gsLoader.Cache.LoadFuzzNames(config.FrontEnd. SkiaVersion.Hash)
139 if err != nil { 139 if err != nil {
140 return fmt.Errorf("Could not load previous fuzz hashes from cach e at revision %s: %s", config.FrontEnd.SkiaVersion.Hash, err) 140 return fmt.Errorf("Could not load previous fuzz hashes from cach e at revision %s: %s", config.FrontEnd.SkiaVersion.Hash, err)
141 } 141 }
142 sort.Strings(currentBadFuzzHashes) 142 sort.Strings(currentBadFuzzHashes)
143 sort.Strings(prevBadFuzzNames) 143 sort.Strings(prevBadFuzzNames)
144 144
145 newBinaryFuzzNames := make([]string, 0, 10) 145 newBinaryFuzzNames := make([]string, 0, 10)
146 for _, h := range currentBadFuzzHashes { 146 for _, h := range currentBadFuzzHashes {
147 if i := sort.SearchStrings(prevBadFuzzNames, h); i < len(prevBad FuzzNames) && prevBadFuzzNames[i] == h { 147 if i := sort.SearchStrings(prevBadFuzzNames, h); i < len(prevBad FuzzNames) && prevBadFuzzNames[i] == h {
148 continue 148 continue
149 } 149 }
150 newBinaryFuzzNames = append(newBinaryFuzzNames, h) 150 newBinaryFuzzNames = append(newBinaryFuzzNames, h)
151 } 151 }
152 152
153 glog.Infof("%d newly found fuzzes from Google Storage. Going to load th em.", len(newBinaryFuzzNames)) 153 glog.Infof("%d newly found fuzzes from Google Storage. Going to load th em.", len(newBinaryFuzzNames))
154 if len(newBinaryFuzzNames) > 0 { 154 if len(newBinaryFuzzNames) > 0 {
155 return f.gsLoader.LoadBinaryFuzzesFromGoogleStorage(newBinaryFuz zNames) 155 return f.gsLoader.LoadBinaryFuzzesFromGoogleStorage(newBinaryFuz zNames)
156 } 156 }
157 return nil 157 return nil
158 } 158 }
159 159
160 func (f *FuzzSyncer) LastCount(category string) FuzzCount { 160 func (f *FuzzSyncer) LastCount(category string) FuzzCount {
161 return f.lastCount[category] 161 return f.lastCount[category]
162 } 162 }
OLDNEW
« no previous file with comments | « fuzzer/go/frontend/gsloader/gsloader.go ('k') | fuzzer/go/fuzzcache/fuzzcache_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698