Skip to content

Commit

Permalink
[chore] Fix flaky target allocator e2e test (#2552)
Browse files Browse the repository at this point in the history
I've made the target allocator Prometheus CR test significantly faster
by avoiding restarts in the metrics checking job, checking a metric that
is available earlier, and decreasing the scrape interval. All this adds
up to the job running 2x as fast.
  • Loading branch information
swiatekm authored Jan 19, 2024
1 parent c73a814 commit bf260f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/e2e/targetallocator-prometheuscr/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ spec:
targetAllocator:
enabled: true
serviceAccount: ta
scrapeInterval: 1s
prometheusCR:
enabled: true
config: |
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/targetallocator-prometheuscr/01-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ spec:
args:
- /bin/sh
- -c
- curl -s http://prometheus-cr-collector:9090/metrics | grep "otelcol_exporter_sent_metric_points_total{"
- |
for i in $(seq 30); do
if curl -m 1 -s http://prometheus-cr-collector:9090/metrics | grep "otelcol"; then exit 0; fi
sleep 5
done
exit 1
---
apiVersion: batch/v1
kind: Job
Expand Down

0 comments on commit bf260f3

Please sign in to comment.