Skip to content

Commit f238e9a

Browse files
Define wait_for_server only once.
1 parent ab84046 commit f238e9a

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

.github/workflows/e2e_integration_test.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
run: sudo apt-get update && sudo apt-get install -y curl
9191
shell: bash
9292

93-
- name: Wait for the SDP to be up
93+
- name: Define helper functions
9494
run: |
9595
wait_for_server() {
9696
local endpoint=$1
@@ -107,7 +107,10 @@ jobs:
107107
done
108108
echo "Server at $endpoint is up."
109109
}
110+
shell: bash
110111

112+
- name: Wait for the SDP to be up
113+
run: |
111114
wait_for_server http://localhost:8000/health 120
112115
wait_for_server http://localhost:8003/health 120
113116
shell: bash
@@ -124,22 +127,6 @@ jobs:
124127

125128
- name: Wait for the Anchor Platform to be up
126129
run: |
127-
wait_for_server() {
128-
local endpoint=$1
129-
local max_wait_time=$2
130-
131-
SECONDS=0
132-
while ! curl -s $endpoint > /dev/null; do
133-
echo "Waiting for server at $endpoint to be up... $SECONDS seconds elapsed"
134-
sleep 4
135-
if [ $SECONDS -ge $max_wait_time ]; then
136-
echo "Server at $endpoint is not up after $max_wait_time seconds."
137-
exit 1
138-
fi
139-
done
140-
echo "Server at $endpoint is up."
141-
}
142-
143130
wait_for_server http://localhost:8080/health 120
144131
wait_for_server http://localhost:8085/health 120
145132
shell: bash

0 commit comments

Comments
 (0)