Skip to content

Commit 5514657

Browse files
authored
feat: add shell to wait for services (#2157)
* feat: add shell to wait for services * fix: add apache license
1 parent 321a195 commit 5514657

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/backend-e2e-test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ jobs:
7474
working-directory: ./api/test/docker
7575
run: |
7676
docker-compose up -d
77-
sleep 5
77+
78+
# wait for services ready
79+
../shell/wait_for_services.sh
80+
7881
docker logs docker_managerapi_1
7982
docker logs docker_apisix_1
8083
@@ -106,7 +109,10 @@ jobs:
106109
working-directory: ./api/test/docker
107110
run: |
108111
docker-compose up -d --build
109-
sleep 5
112+
113+
# wait for services ready
114+
../shell/wait_for_services.sh
115+
110116
docker logs docker_managerapi_1
111117
112118
- name: run test for plugin skywalking
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership.
7+
# The ASF licenses this file to You under the Apache License, Version 2.0
8+
# (the "License"); you may not use this file except in compliance with
9+
# the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
i=1
21+
timeout=60
22+
while ! curl -s 127.0.0.1:12800 >/dev/null; do
23+
if [[ "$i" -gt "$timeout" ]]; then
24+
echo "timeout occurred after waiting $timeout seconds"
25+
exit 1
26+
fi
27+
sleep 1
28+
echo "waited skywalking for $i seconds.."
29+
((i++));
30+
done

0 commit comments

Comments
 (0)