grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
30 stars 1 forks source link

Failing GCP Test - `TestGCP_CollectMetrics/two_collectors_with_no_errors` #201

Open logyball opened 3 months ago

logyball commented 3 months ago

Test is failing on the main branch:

--- FAIL: TestGCP_CollectMetrics (0.00s)
    --- FAIL: TestGCP_CollectMetrics/two_collectors_with_no_errors (0.00s)
        gcp_test.go:206: 
                Error Trace:    /Users/loganballard/projects/cloudcost-exporter/pkg/google/gcp_test.go:206
                Error:          Not equal: 
                                expected: &utils.MetricResult{FqName:"cloudcost_exporter_collector_last_scrape_duration_seconds", Labels:utils.LabelMap{"collector":"test", "provider":"gcp"}, Value:0, MetricType:2}
                                actual  : &utils.MetricResult{FqName:"cloudcost_exporter_collector_last_scrape_error", Labels:utils.LabelMap{"collector":"test", "provider":"gcp"}, Value:0, MetricType:2}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,3 +1,3 @@
                                 (*utils.MetricResult)({
                                - FqName: (string) (len=57) "cloudcost_exporter_collector_last_scrape_duration_seconds",
                                + FqName: (string) (len=46) "cloudcost_exporter_collector_last_scrape_error",
                                  Labels: (utils.LabelMap) (len=2) {
                Test:           TestGCP_CollectMetrics/two_collectors_with_no_errors
FAIL
FAIL    github.com/grafana/cloudcost-exporter/pkg/google        0.304s

@Pokom left a comment here

                // TODO: @pokom need to figure out why _sometimes_ this fails if we set it to *.Times(tt.numCollectors)