Skip to content

Commit a598d79

Browse files
committed
Debug test
1 parent 3edb376 commit a598d79

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

http-tests/admin/model/ontology-import-upload-no-deadlock.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,42 @@ echo "DEBUG: Using cert: $OWNER_CERT_FILE"
9393
# Use temporary file to capture curl output and status
9494
temp_output=$(mktemp)
9595
temp_stderr=$(mktemp)
96+
echo "DEBUG: Created temp files: $temp_output, $temp_stderr"
97+
9698
request_pid=""
9799
(
100+
echo "DEBUG: [subprocess] Starting curl request..." >&2
98101
curl -k -f -w "\nHTTP_STATUS:%{http_code}\n" \
99102
-E "$OWNER_CERT_FILE":"$OWNER_CERT_PWD" \
100103
-H "Accept: application/n-triples" \
101104
"$namespace_doc" > "$temp_output" 2> "$temp_stderr"
105+
curl_result=$?
106+
echo "DEBUG: [subprocess] Curl finished with exit code: $curl_result" >&2
107+
exit $curl_result
102108
) &
103109
request_pid=$!
110+
echo "DEBUG: Background process PID: $request_pid"
104111

105112
# Wait up to 30 seconds for the request to complete
106113
timeout_seconds=30
107114
elapsed=0
115+
echo "DEBUG: Entering wait loop..."
108116
while kill -0 "$request_pid" 2>/dev/null; do
109117
if [ $elapsed -ge $timeout_seconds ]; then
110118
kill -9 "$request_pid" 2>/dev/null || true
111119
echo "ERROR: Request timed out after ${timeout_seconds} seconds - deadlock detected!"
112120
echo "DEBUG: Curl stderr output:"
113-
cat "$temp_stderr"
121+
cat "$temp_stderr" || echo "(could not read stderr file)"
114122
rm -f "$temp_output" "$temp_stderr"
115123
exit 1
116124
fi
117125
sleep 1
118126
((elapsed++))
119127
done
128+
echo "DEBUG: Exited wait loop after ${elapsed}s"
120129

121130
# Check if curl succeeded
131+
echo "DEBUG: Calling wait on PID $request_pid..."
122132
wait "$request_pid"
123133
curl_exit_code=$?
124134

0 commit comments

Comments
 (0)