-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-me-local.sh
More file actions
executable file
·39 lines (30 loc) · 827 Bytes
/
run-me-local.sh
File metadata and controls
executable file
·39 lines (30 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
MAX_EXEC_TIME=300
VERSION="$(cat VERSION)"
export VERSION
function handle_timeout() {
echo "Script timed out after ${MAX_EXEC_TIME} seconds"
exit 1
}
function cleanup() {
echo "Caught Ctrl-C, cleaning up..."
pkill -P $$ || true
echo "Terminated running tasks."
exit 1
}
declare -A params=()
declare -A documentation=()
export params
export documentation
trap cleanup SIGINT
# 12m57s timeout for test-in-timeout.sh where tester.sh is invoked inside docker
# 777 => 12m57s => 12 57 ms => 6 9 ms => 6 9 (13) (19) => 369 9/11
# 777 => 369 9/11 [[[ REALITY IS A PROGRAM ]]]
# PROGRAM OR BE PROGRAMMED
if command -v timeout; then
timeout --foreground --kill-after=777s "${MAX_EXEC_TIME}s" bash <<'EOF' || handle_timeout
source testing/test-in-timeout.sh
EOF
else
source testing/test-in-timeout.sh
fi