Unstable unit test: TestSubnetPrefixInPrometheusMetrics
The TestSubnetPrefixInPrometheusMetrics
test from backend/agent/promkeaexporter_test.go
unexpectedly fails one or two times per day.
=== RUN TestSubnetPrefixInPrometheusMetrics
time="2023-01-19T11:35:47Z" level=error msg="open /var/lib/stork-agent/certs/ca.pem: no such file or directory\ncould not read CA certificate: /var/lib/stork-agent/certs/ca.pem\nisc.org/stork/agent.readTLSCredentials\n\t/builds/isc-projects/stork/backend/agent/caclient.go:112\nisc.org/stork/agent.NewHTTPClient\n\t/builds/isc-projects/stork/backend/agent/caclient.go:39\nisc.org/stork/agent.NewPromKeaExporter\n\t/builds/isc-projects/stork/backend/agent/promkeaexporter.go:347\nisc.org/stork/agent.TestSubnetPrefixInPrometheusMetrics\n\t/builds/isc-projects/stork/backend/agent/promkeaexporter_test.go:289\ntesting.tRunner\n\t/builds/isc-projects/stork/tools/golang/go/src/testing/testing.go:1439\nruntime.goexit\n\t/builds/isc-projects/stork/tools/golang/go/src/runtime/asm_amd64.s:1571"
time="2023-01-19T11:35:47Z" level=warning msg="cannot read TLS credentials, use HTTP protocol, open /var/lib/stork-agent/certs/ca.pem: no such file or directory\ncould not read CA certificate: /var/lib/stork-agent/certs/ca.pem\nisc.org/stork/agent.readTLSCredentials\n\t/builds/isc-projects/stork/backend/agent/caclient.go:112\nisc.org/stork/agent.NewHTTPClient\n\t/builds/isc-projects/stork/backend/agent/caclient.go:39\nisc.org/stork/agent.NewPromKeaExporter\n\t/builds/isc-projects/stork/backend/agent/promkeaexporter.go:347\nisc.org/stork/agent.TestSubnetPrefixInPrometheusMetrics\n\t/builds/isc-projects/stork/backend/agent/promkeaexporter_test.go:289\ntesting.tRunner\n\t/builds/isc-projects/stork/tools/golang/go/src/testing/testing.go:1439\nruntime.goexit\n\t/builds/isc-projects/stork/tools/golang/go/src/runtime/asm_amd64.s:1571"
time="2023-01-19T11:35:47Z" level=info msg="the Basic Auth credentials file (/etc/stork/agent-credentials.json) is missing - HTTP authentication is not used"
time="2023-01-19T11:35:47Z" level=info msg="Prometheus Kea Exporter listening on :1234, stats pulling interval: 1 seconds"
time="2023-01-19T11:35:48Z" level=info msg=GetApps
promkeaexporter_test.go:303:
Error Trace: promkeaexporter_test.go:303
Error: Not equal:
expected: 13
actual : 0
Test: TestSubnetPrefixInPrometheusMetrics
time="2023-01-19T11:35:48Z" level=info msg="Stopping Prometheus Kea Exporter"
time="2023-01-19T11:35:48Z" level=error msg="Problem serving Prometheus Kea Exporter: http: Server closed"
time="2023-01-19T11:35:48Z" level=info msg="Stopped Prometheus Kea Exporter"
--- FAIL: TestSubnetPrefixInPrometheusMetrics (1.01s)