File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,19 +27,26 @@ cd "$(dirname "$0")"
2727
2828export LD_LIBRARY_PATH=/usr/lib:/lib:/home/root:${MY_DIR}
2929
30- # Start HTTP server in background
31- python3 -m http.server 8000 &
32- HTTP_PID=$!
33-
34- # Register cleanup trap to stop HTTP server on exit
35- trap '
36- kill $HTTP_PID 2>/dev/null || true
37- wait $HTTP_PID 2>/dev/null || true
38- ' EXIT
30+ HTTP_PORT=8000
31+ HTTP_PID=" "
32+
33+ # Check if HTTP server is already running
34+ if ! lsof -iTCP:${HTTP_PORT} -sTCP:LISTEN > /dev/null 2>&1 ; then
35+ python3 -m http.server ${HTTP_PORT} &
36+ HTTP_PID=$!
37+ fi
38+
39+ # Cleanup only if this script started the server
40+ cleanup () {
41+ if [[ -n " $HTTP_PID " ]]; then
42+ kill " $HTTP_PID " 2> /dev/null || true
43+ wait " $HTTP_PID " 2> /dev/null || true
44+ fi
45+ }
46+ trap cleanup EXIT
3947
4048# Run test
41- ./ut_control_test " $@ "
49+ LSAN_OPTIONS= " suppressions=../../lsan.supp print_suppressions=1 " ./ut_control_test " $@ "
4250UT_STATUS=$?
4351
44- # Exit with same status as UT test
45- exit $UT_STATUS
52+ exit $UT_STATUS
You can’t perform that action at this time.
0 commit comments