File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ STORAGE_ARGS="-config-yaml=/tests/schema1.yaml -dynamodb.url=dynamodb://u:p@dyna
9
9
INGESTER_ARGS=" $COMMON_ARGS $STORAGE_ARGS -ingester.num-tokens=4 -ingester.min-ready-duration=1s --ingester.final-sleep=0s -ingester.concurrent-flushes=5"
10
10
RUN_ARGS=" --net=cortex -v $TEST_DIR :/tests"
11
11
12
+ # Run curl on the same network as the test containers (on CircleCI this is not connected to the host)
13
+ run_curl () {
14
+ docker run $RUN_ARGS --rm byrnedo/alpine-curl " $@ "
15
+ }
16
+
12
17
# Execute command $1 repeatedly until it returns true; description in $2, optional repeat limit in $3
13
18
wait_for () {
14
19
reps=${3:- 10}
Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ docker run $RUN_ARGS -d --name=i1 --hostname=i1 quay.io/cortexproject/ingester:$
16
16
17
17
sleep 5
18
18
I1_ADDR=$( container_ip i1)
19
- wait_for " curl -s -f -m 3 $I1_ADDR /ready" " ingester ready"
19
+ wait_for " run_curl -s -f -m 3 $I1_ADDR /ready" " ingester ready"
20
20
21
21
has_tokens_owned () {
22
- curl -s -f -m 3 $1 /metrics | grep ' cortex_ring_tokens_owned' > /dev/null
22
+ run_curl -s -f -m 3 $1 /metrics | grep ' cortex_ring_tokens_owned' > /dev/null
23
23
}
24
24
DIST_ADDR=$( container_ip distributor)
25
25
wait_for " has_tokens_owned $DIST_ADDR " " distributor to see ingester in ring"
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ echo Start first ingester
12
12
docker run $RUN_ARGS -d --name=i1 --hostname=i1 quay.io/cortexproject/ingester:$IMAGE_TAG $INGESTER_ARGS -ingester.claim-on-rollout=true
13
13
14
14
I1_ADDR=$( container_ip i1)
15
- wait_for " curl -s -f -m 3 $I1_ADDR :/ready" " ingester ready"
15
+ wait_for " run_curl -s -f -m 3 $I1_ADDR :/ready" " ingester ready"
16
16
17
17
has_tokens_owned () {
18
- curl -s -f -m 3 $1 :/metrics | grep -q ' cortex_ring_tokens_owned'
18
+ run_curl -s -f -m 3 $1 :/metrics | grep -q ' cortex_ring_tokens_owned'
19
19
}
20
20
DIST_ADDR=$( container_ip distributor)
21
21
wait_for " has_tokens_owned $DIST_ADDR " " distributor to see ingester in ring"
You can’t perform that action at this time.
0 commit comments