Skip to content

Commit

Permalink
fix: wait cluster start up
Browse files Browse the repository at this point in the history
  • Loading branch information
newborn22 committed Dec 4, 2024
1 parent cca04d6 commit 919b9c7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/new_endtoend_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ jobs:
$WESCALE_CI_IMAGE \
/vt/examples/wesql-server/init_single_node_cluster.sh
- name: Wait for MySQL ports
run: |
timeout=300 # 5 minutes timeout
ports=(3306 15306)
for port in "${ports[@]}"; do
echo "Waiting for MySQL port $port..."
start_time=$(date +%s)
while ! nc -z localhost $port; do
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for MySQL port $port"
exit 1
fi
echo "Port $port not ready. Retrying in 5 seconds..."
sleep 5
done
echo "MySQL port $port is ready!"
done
- name: Run EndToEnd test
run: |
cd endtoend
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/new_endtoend_test_for_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,29 @@ jobs:
$WESCALE_CI_IMAGE \
/vt/examples/wesql-server/init_single_node_cluster.sh
- name: Wait for MySQL ports
run: |
timeout=300 # 5 minutes timeout
ports=(3306 3307 15306 15307)
for port in "${ports[@]}"; do
echo "Waiting for MySQL port $port..."
start_time=$(date +%s)
while ! nc -z localhost $port; do
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for MySQL port $port"
exit 1
fi
echo "Port $port not ready. Retrying in 5 seconds..."
sleep 5
done
echo "MySQL port $port is ready!"
done
- name: Run EndToEnd test
run: |
cd endtoend
Expand Down

0 comments on commit 919b9c7

Please sign in to comment.