File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 4747 LOCALSTACK_API_KEY : ${{ secrets.TEST_LOCALSTACK_API_KEY }}
4848 DNS_ADDRESS : 127.0.0.1
4949 DEBUG : 1
50- timeout-minutes : 50
50+ timeout-minutes : 200
5151 run : make test-ci-all
Original file line number Diff line number Diff line change 2626 @localstack logs > logs.txt
2727
2828test-ci :
29- make start install ready run; return_code=` echo $$ ? ` ; \
29+ TIMEOUT_MINUTES=2 make start install ready; \
30+ return_code=` echo $$ ? ` ; \
31+ TIMEOUT_MINUTES=2 ./run.sh; \
3032 make logs; make stop; exit $$ return_code;
3133
3234.PHONY : usage install start run stop ready logs test-ci
33-
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ GLUE_DATABASE_NAME="gluedb"
1111GLUE_CONNECTION_NAME=" glueconnection"
1212GLUE_CRAWLER_NAME=" gluecrawler"
1313
14+ # Read timeout from environment variable, default to no timeout if not set
15+ TIMEOUT_MINUTES=${TIMEOUT_MINUTES:- }
16+ TIMEOUT_SECONDS=$(( TIMEOUT_MINUTES * 60 ))
17+
1418# Tear-down function to cleanup on exit
1519function cleanup() {
1620 echo " "
@@ -30,10 +34,19 @@ wait () {
3034 command=$1
3135 field=$2
3236 expected=$3
37+ start_time=$( date +%s)
3338 current=$( $command | jq -r $field )
39+
3440 while [ " $current " != " $expected " ]; do
3541 sleep 5
36- echo " Waiting for state change. Current: $current / Expected: $expected "
42+ elapsed_time=$(( $(date +% s) - start_time ))
43+
44+ if [ -n " $TIMEOUT_MINUTES " ] && [ $elapsed_time -ge $TIMEOUT_SECONDS ]; then
45+ echo " Timeout after $TIMEOUT_SECONDS seconds. Current: $current / Expected: $expected "
46+ exit 1
47+ fi
48+
49+ echo " Waiting for state change. Current: $current / Expected: $expected . Elapsed time: $elapsed_time seconds"
3750 current=$( $command | jq -r $field )
3851 done
3952}
@@ -67,4 +80,4 @@ wait "awslocal glue get-crawler --name $GLUE_CRAWLER_NAME" ".Crawler.State" "REA
6780echo " Getting Glue table..."
6881awslocal glue get-table --database-name $GLUE_DATABASE_NAME --name " ${REDSHIFT_DATABASE_NAME} _${REDSHIFT_SCHEMA_NAME} _${REDSHIFT_TABLE_NAME} "
6982
70- echo " Done."
83+ echo " Done."
You can’t perform that action at this time.
0 commit comments