Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions keploy/keploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,6 @@ func (k *Keploy) fetch() []models.TestCase {
k.Log.Error("failed to fetch testcases from keploy cloud", zap.Error(errors.New("failed to send get request: "+resp.Status)))
return nil
}

defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
k.Log.Error("failed to fetch testcases from keploy cloud", zap.Error(err))
Expand All @@ -631,13 +629,18 @@ func (k *Keploy) fetch() []models.TestCase {
return nil
}
tcs = append(tcs, res...)
if len(res) < pageSize {
break
}
eof := resp.Header.Get("EOF")
err = resp.Body.Close()
if err != nil {
k.Log.Error("failed to close keploy resp while fetching testcases from keploy", zap.Error(err))
}
if eof == "true" {
break
}

if len(res) < pageSize {
break
}
}
return tcs
}
Expand Down