-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retry MGS metrics checks if timeseries are missing (#6458)
The test `integration_tests::metrics::test_mgs_metrics` has failed flakily a few times on `main` and PRs (see #6454). This is due to a race condition where we attempt to test that the expected timeseries exist when they haven't yet been collected. The test waits for the Oximeter producer endpoint to be *registered*, and then immediately triggers the metrics collection: https://github.com/oxidecomputer/omicron/blob/a0cdce7395cec5813fc697172b8a28a69d27093d/nexus/tests/integration_tests/metrics.rs#L741-L745 However, if we look at the logs, we see that when we trigger Oximeter to collect the metrics, the SP pollers haven't produced any samples yet. We can see that Oximeter does collect metrics from the MGS instance, it just doesn't have anything yet: https://buildomat.eng.oxide.computer/wg/0/artefact/01J6AC5R3TN7HA7J5XR46XM9JM/nxMhUQ2DddPGyS7EJUzyESwgw1GGhoLMU8bPmZEIGVtDZ9q6/01J6AC6HPHGKFQN3CY1YJ15JEC/01J6AF1QQQNVH0P76YGCVTX5JX/test_all-33bc5def8da77203-test_mgs_metrics.130753.4.log?format=x-bunyan#L106 This commit fixes this issue by wrapping the code that checks whether the expected timeseries exist in a `poll::wait_for_condition`, allowing them to be retried if some (or all) timeseries are not yet present. We force Oximeter to collect any new samples on each retry. If we encounter an unexpected timeseries, the test panics immediately, but if some expected timeseries aren't present, we retry for up to 30 seconds. If they're still not there, *then* the test fails. Fixes #6454
- Loading branch information
Showing
1 changed file
with
84 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters