Skip to content

Commit

Permalink
go/oasis-test-runner/cmd/cmp: Remove use of EarlyLogAndExit()
Browse files Browse the repository at this point in the history
Instead, return an ordinary error which is then propagated and printed
to logs accordingly.
  • Loading branch information
tjanez committed Jun 24, 2020
1 parent f5f906b commit 83a464a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/oasis-test-runner/cmd/cmp/cmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func getDuration(ctx context.Context, test string, bi *model.SampleStream) (floa
query := fmt.Sprintf("%s %s == 1.0", metrics.MetricUp, bi.Metric.String())
result, warnings, err := v1api.QueryRange(ctx, query, r)
if err != nil {
nodeCommon.EarlyLogAndExit(fmt.Errorf("error querying Prometheus: %w", err))
return 0, 0, fmt.Errorf("error querying Prometheus: %w", err)
}
if len(warnings) > 0 {
cmpLogger.Warn("warnings while querying Prometheus", "warnings", warnings)
Expand Down Expand Up @@ -206,7 +206,7 @@ func getSummableMetric(ctx context.Context, metric string, test string, bi *mode

result, warnings, err := v1api.Query(ctx, query, t)
if err != nil {
nodeCommon.EarlyLogAndExit(fmt.Errorf("error querying Prometheus: %w", err))
return 0, 0, fmt.Errorf("error querying Prometheus: %w", err)
}
if len(warnings) > 0 {
cmpLogger.Warn("warnings while querying Prometheus", "warnings", warnings)
Expand Down Expand Up @@ -256,7 +256,7 @@ func getNetwork(ctx context.Context, test string, bi *model.SampleStream) (float
query := fmt.Sprintf("(%s %s)", rxtx, labels.String())
result, warnings, err := v1api.QueryRange(ctx, query, r)
if err != nil {
nodeCommon.EarlyLogAndExit(fmt.Errorf("error querying Prometheus: %w", err))
return 0, 0, fmt.Errorf("error querying Prometheus: %w", err)
}
if len(warnings) > 0 {
cmpLogger.Warn("warnings while querying Prometheus", "warnings", warnings)
Expand Down

0 comments on commit 83a464a

Please sign in to comment.