Skip to content

Commit

Permalink
Merge pull request redpanda-data#14592 from oleiman/ci/14565/metrics-…
Browse files Browse the repository at this point in the history
…incomplete-fix

ducktape/audit_log_test: Fix racy metrics test
  • Loading branch information
oleiman authored Nov 8, 2023
2 parents 9fc4ad1 + eed20e1 commit 491a0d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/rptest/tests/audit_log_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ def number_of_records_matching(filter_by, n_expected):
self.logger.debug("Finished 500 api calls with management disabled")
_ = number_of_records_matching(api_keys, 1000)

@ok_to_fail # https://github.com/redpanda-data/redpanda/issues/14565
@cluster(num_nodes=4)
def test_audit_log_metrics(self):
"""
Expand All @@ -597,7 +596,8 @@ def get_metrics_from_node(
def get_metrics_from_node_sync(patterns: list[str]):
samples = self.redpanda.metrics_samples(
patterns, [node], endpoint)
success = samples is not None
success = samples is not None and set(
samples.keys()) == set(patterns)
return success, samples

try:
Expand All @@ -620,14 +620,14 @@ def get_metrics_from_node_sync(patterns: list[str]):
for node in self.redpanda.nodes:
samples = get_metrics_from_node(node, metrics)
assert samples, f"Missing expected metrics from node {node.name}"
assert sorted(samples.keys()) == sorted(
assert set(samples.keys()) == set(
metrics), f"Metrics incomplete: {samples.keys()}"

for node in self.redpanda.nodes:
samples = get_metrics_from_node(node, metrics,
samples = get_metrics_from_node(node, public_metrics,
MetricsEndpoint.PUBLIC_METRICS)
assert samples, f"Missing expected public metrics from node {node.name}"
assert sorted(samples.keys()) == sorted(
assert set(samples.keys()) == set(
public_metrics), f"Public metrics incomplete: {samples.keys()}"

# Remove management setting
Expand Down

0 comments on commit 491a0d2

Please sign in to comment.