diff options
| author | Taras Madan <tarasmadan@google.com> | 2024-04-04 15:00:58 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-04-05 10:36:40 +0000 |
| commit | 77230c294a419a97f63f155760d210bed1bc26a8 (patch) | |
| tree | e33cbb950cd409166178710d8e3b9bf94ffd3564 /syz-ci | |
| parent | 47d9c0edfbe59bff64dc279a63d2dce54552cf12 (diff) | |
syz-ci/manager.go: don't upload empty reports
I observe the reports with 0 len.
I'm sure it happens because of the connection timeouts etc.
Diffstat (limited to 'syz-ci')
| -rw-r--r-- | syz-ci/manager.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/syz-ci/manager.go b/syz-ci/manager.go index 2a5d2c196..542d3950e 100644 --- a/syz-ci/manager.go +++ b/syz-ci/manager.go @@ -879,9 +879,15 @@ func (mgr *Manager) uploadCoverStat(fuzzingMinutes int) error { resp, err := mgr.httpGET("/cover?jsonl=1") if err != nil { - return fmt.Errorf("failed to get /cover?json=1 report: %w", err) + return fmt.Errorf("failed to httpGet /cover?jsonl=1 report: %w", err) } defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + sb := new(strings.Builder) + io.Copy(sb, resp.Body) + return fmt.Errorf("failed to GET /cover?jsonl=1, httpStatus %d: %s", + resp.StatusCode, sb.String()) + } curTime := time.Now() pr, pw := io.Pipe() @@ -915,8 +921,7 @@ func (mgr *Manager) uploadCoverStat(fuzzingMinutes int) error { mgr.mgrcfg.DashboardClient, mgr.name, curTime.Format(time.DateOnly), curTime.Hour(), curTime.Minute()) - err = mgr.uploadFile(mgr.cfg.CoverPipelinePath, fileName, pr, false) - if err != nil { + if err := mgr.uploadFile(mgr.cfg.CoverPipelinePath, fileName, pr, false); err != nil { return fmt.Errorf("failed to uploadFileGCS(): %w", err) } return nil |
