Problem
TestStatsFileHasNoCredentials_118 in cmd/ingestor/mqtt_status_credentials_118_test.go fails intermittently:
mqtt_status_credentials_118_test.go:222: stats file leaks "1234": {"sampledAt":"...", ...}
secretParts118 includes very short numeric "secrets" ("1234", "2024") and "abc". The test then asserts that none of them occurs anywhere in the whole stats-file JSON. That JSON contains timestamps, Unix times, counters and byte sizes, so any number that happens to contain 1234 fails the test, even though no credential leaked. It was seen on PR #246, a server-only change.
Proposed fix
- Use secret test values that cannot occur by chance in numbers or timestamps, e.g.
zq1234zq and pw2024pw, in the broker URLs and in secretParts118. Keep the coverage: masked user, password, query and fragment parts.
- Optionally, assert only on the string fields that can carry broker text (error texts, broker labels) instead of the whole JSON blob.
Acceptance
Problem
TestStatsFileHasNoCredentials_118incmd/ingestor/mqtt_status_credentials_118_test.gofails intermittently:secretParts118includes very short numeric "secrets" ("1234","2024") and"abc". The test then asserts that none of them occurs anywhere in the whole stats-file JSON. That JSON contains timestamps, Unix times, counters and byte sizes, so any number that happens to contain1234fails the test, even though no credential leaked. It was seen on PR #246, a server-only change.Proposed fix
zq1234zqandpw2024pw, in the broker URLs and insecretParts118. Keep the coverage: masked user, password, query and fragment parts.Acceptance
errForLogreturns the raw error).1234, or with-count=200.