Skip to content

Commit

Permalink
Fix failed create call not handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfijal authored and robingustafsson committed May 10, 2017
1 parent f5aef4f commit fdeb390
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions stats/cloud/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/loadimpact/k6/stats"
"github.com/pkg/errors"
)

type sample struct {
Expand Down Expand Up @@ -47,6 +48,10 @@ func (c *Client) CreateTestRun(testRun *TestRun) (*CreateTestRunResponse, error)
return nil, err
}

if ctrr.ReferenceID == "" {
return nil, errors.Errorf("Failed to get a reference ID")
}

return &ctrr, nil
}

Expand Down
2 changes: 1 addition & 1 deletion stats/cloud/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (c *Collector) Run(ctx context.Context) {
}
}

if c.referenceID == "" {
if c.referenceID != "" {
err := c.client.TestFinished(c.referenceID, thresholdResults, testTainted)
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit fdeb390

Please sign in to comment.