@@ -86,14 +86,19 @@ echo "Cleared ontology cache to force reload"
8686# Use portable timeout implementation (works on both macOS and Linux)
8787
8888echo " Making request to trigger ontology loading (testing for deadlock)..."
89+ echo " DEBUG: Target URL: $namespace_doc "
90+ echo " DEBUG: Using cert: $OWNER_CERT_FILE "
8991
9092# Portable timeout function - works on both macOS and Linux
93+ # Use temporary file to capture curl output and status
94+ temp_output=$( mktemp)
95+ temp_stderr=$( mktemp)
9196request_pid=" "
9297(
93- curl -k -f -s \
98+ curl -k -f -w " \nHTTP_STATUS:%{http_code}\n " \
9499 -E " $OWNER_CERT_FILE " :" $OWNER_CERT_PWD " \
95100 -H " Accept: application/n-triples" \
96- " $namespace_doc " > /dev/null
101+ " $namespace_doc " > " $temp_output " 2> " $temp_stderr "
97102) &
98103request_pid=$!
99104
@@ -104,6 +109,9 @@ while kill -0 "$request_pid" 2>/dev/null; do
104109 if [ $elapsed -ge $timeout_seconds ]; then
105110 kill -9 " $request_pid " 2> /dev/null || true
106111 echo " ERROR: Request timed out after ${timeout_seconds} seconds - deadlock detected!"
112+ echo " DEBUG: Curl stderr output:"
113+ cat " $temp_stderr "
114+ rm -f " $temp_output " " $temp_stderr "
107115 exit 1
108116 fi
109117 sleep 1
@@ -113,11 +121,26 @@ done
113121# Check if curl succeeded
114122wait " $request_pid "
115123curl_exit_code=$?
124+
125+ echo " DEBUG: Curl exit code: $curl_exit_code "
126+ echo " DEBUG: Curl stderr:"
127+ cat " $temp_stderr "
128+ echo " DEBUG: Response (first 500 chars):"
129+ head -c 500 " $temp_output "
130+ echo " "
131+
116132if [ $curl_exit_code -ne 0 ]; then
117133 echo " ERROR: Request failed with exit code $curl_exit_code "
134+ rm -f " $temp_output " " $temp_stderr "
118135 exit 1
119136fi
120137
138+ # Extract HTTP status code
139+ http_status=$( grep " HTTP_STATUS:" " $temp_output " | cut -d' :' -f2)
140+ echo " DEBUG: HTTP status code: $http_status "
141+
142+ rm -f " $temp_output " " $temp_stderr "
143+
121144echo " Request completed successfully in ${elapsed} s (no deadlock)"
122145
123146# Step 6: Verify the import is present in the loaded ontology
0 commit comments