Skip to content

Commit bf260f3

Browse files
authored
[chore] Fix flaky target allocator e2e test (open-telemetry#2552)
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.
1 parent c73a814 commit bf260f3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/e2e/targetallocator-prometheuscr/00-install.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ spec:
104104
targetAllocator:
105105
enabled: true
106106
serviceAccount: ta
107+
scrapeInterval: 1s
107108
prometheusCR:
108109
enabled: true
109110
config: |

tests/e2e/targetallocator-prometheuscr/01-install.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ spec:
1313
args:
1414
- /bin/sh
1515
- -c
16-
- curl -s http://prometheus-cr-collector:9090/metrics | grep "otelcol_exporter_sent_metric_points_total{"
16+
- |
17+
for i in $(seq 30); do
18+
if curl -m 1 -s http://prometheus-cr-collector:9090/metrics | grep "otelcol"; then exit 0; fi
19+
sleep 5
20+
done
21+
exit 1
1722
---
1823
apiVersion: batch/v1
1924
kind: Job

0 commit comments

Comments
 (0)