Skip to content

Commit

Permalink
test: Improve flaky integration test (#4407)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde authored Dec 18, 2024
1 parent b1a8843 commit 1dc9941
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/integration/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def test_enforce_bucket_rate_limits(
"aggregator": {
"bucket_interval": 1,
"initial_delay": 0,
"shift_key": "bucket",
"shift_key": "project",
},
}
)
Expand Down Expand Up @@ -591,15 +591,17 @@ def make_bucket(name, type_, values):
"width": 1,
}

relay.send_metrics_buckets(
project_id,
[
make_bucket(f"d:transactions/measurements.lcp{i}@millisecond", "d", [1.0])
for i in range(metric_bucket_limit * 2)
],
)
buckets = [
make_bucket(f"d:transactions/measurements.lcp{i}@millisecond", "d", [1.0])
for i in range(metric_bucket_limit)
]

# Send as many metrics as the quota allows.
relay.send_metrics_buckets(project_id, buckets)
metrics_consumer.get_metrics(n=metric_bucket_limit)

# Send metrics again, at this point the quota is exhausted.
relay.send_metrics_buckets(project_id, buckets)
metrics_consumer.assert_empty()


Expand Down

0 comments on commit 1dc9941

Please sign in to comment.