Skip to content

Commit b4762f4

Browse files
ci: added timeout to integration tests
1 parent d83534b commit b4762f4

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/integration-tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ on:
2121
required: false
2222
type: string
2323
default: ''
24+
test_timeout_seconds:
25+
description: 'Timeout for each integration test in seconds'
26+
required: false
27+
type: number
28+
default: 1800
2429

2530
jobs:
2631
build-integration-tests:
@@ -108,7 +113,21 @@ jobs:
108113
chmod +x ./target/debug/${{ matrix.test_binary }}
109114
110115
- name: "Run ${{ matrix.test_binary }}"
111-
run: ./target/debug/${{ matrix.test_binary }}
116+
run: |
117+
TIMEOUT_SECONDS=${{ inputs.test_timeout_seconds }}
118+
echo "Running test with ${TIMEOUT_SECONDS} second timeout..."
119+
120+
timeout ${TIMEOUT_SECONDS} ./target/debug/${{ matrix.test_binary }} || EXIT_CODE=$?
121+
122+
if [ "${EXIT_CODE:-0}" -eq 124 ]; then
123+
echo "ERROR: Test '${{ matrix.test_binary }}' timed out after ${TIMEOUT_SECONDS} seconds."
124+
exit 1
125+
elif [ "${EXIT_CODE:-0}" -ne 0 ]; then
126+
echo "ERROR: Test '${{ matrix.test_binary }}' failed with exit code ${EXIT_CODE}."
127+
exit ${EXIT_CODE}
128+
fi
129+
130+
echo "Test completed successfully."
112131
env:
113132
SEED: 0
114133

0 commit comments

Comments
 (0)