mirror of
https://github.com/katanemo/plano.git
synced 2026-04-30 11:26:27 +02:00
Add support for streaming and fixes few issues (see description) (#202)
This commit is contained in:
parent
29ff8da60f
commit
662a840ac5
45 changed files with 2266 additions and 477 deletions
33
e2e_tests/common_scripts.sh
Normal file
33
e2e_tests/common_scripts.sh
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
log() {
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
message="$*"
|
||||
echo "$timestamp: $message"
|
||||
}
|
||||
|
||||
wait_for_healthz() {
|
||||
local healthz_url="$1"
|
||||
local timeout_seconds="${2:-30}" # Default timeout of 30 seconds
|
||||
local sleep_between="${3:-5}" # Default sleep of 5 seconds
|
||||
|
||||
local start_time=$(date +%s)
|
||||
|
||||
while true; do
|
||||
local response_code=$(curl -s -o /dev/null -w "%{http_code}" "$healthz_url")
|
||||
|
||||
log "Healthz endpoint $healthz_url response code: $response_code"
|
||||
if [[ "$response_code" -eq 200 ]]; then
|
||||
log "Healthz endpoint is healthy. Proceeding..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
local elapsed_time=$(( $(date +%s) - $start_time ))
|
||||
if [[ $elapsed_time -ge $timeout_seconds ]]; then
|
||||
log "Timeout reached. Healthz endpoint is still unhealthy. Exiting..."
|
||||
return 1
|
||||
fi
|
||||
|
||||
sleep $sleep_between
|
||||
done
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue