@@ -86,74 +86,41 @@ 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 "
9189
9290# 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)
96- echo " DEBUG: Created temp files: $temp_output , $temp_stderr "
97-
9891request_pid=" "
9992(
100- echo " DEBUG: [subprocess] Starting curl request..." >&2
101- curl -k -f -w " \nHTTP_STATUS:%{http_code}\n" \
93+ curl -k -f -s \
10294 -E " $OWNER_CERT_FILE " :" $OWNER_CERT_PWD " \
10395 -H " Accept: application/n-triples" \
104- " $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
96+ " $namespace_doc " > /dev/null
10897) &
10998request_pid=$!
110- echo " DEBUG: Background process PID: $request_pid "
11199
112100# Wait up to 30 seconds for the request to complete
113101timeout_seconds=30
114102elapsed=0
115- echo " DEBUG: Entering wait loop..."
116103while kill -0 " $request_pid " 2> /dev/null; do
117104 if [ $elapsed -ge $timeout_seconds ]; then
118105 kill -9 " $request_pid " 2> /dev/null || true
119106 echo " ERROR: Request timed out after ${timeout_seconds} seconds - deadlock detected!"
120- echo " DEBUG: Curl stderr output:"
121- cat " $temp_stderr " || echo " (could not read stderr file)"
122- rm -f " $temp_output " " $temp_stderr "
123107 exit 1
124108 fi
125109 sleep 1
126110 elapsed=$(( elapsed + 1 ))
127111done
128- echo " DEBUG: Exited wait loop after ${elapsed} s"
129112
130113# Check if curl succeeded
131- echo " DEBUG: Calling wait on PID $request_pid ..."
132114set +e # Temporarily disable exit-on-error for wait
133115wait " $request_pid "
134116curl_exit_code=$?
135117set -e # Re-enable exit-on-error
136- echo " DEBUG: wait returned: $curl_exit_code "
137-
138- echo " DEBUG: Curl exit code: $curl_exit_code "
139- echo " DEBUG: Curl stderr:"
140- cat " $temp_stderr "
141- echo " DEBUG: Response (first 500 chars):"
142- head -c 500 " $temp_output "
143- echo " "
144118
145119if [ $curl_exit_code -ne 0 ]; then
146120 echo " ERROR: Request failed with exit code $curl_exit_code "
147- rm -f " $temp_output " " $temp_stderr "
148121 exit 1
149122fi
150123
151- # Extract HTTP status code
152- http_status=$( grep " HTTP_STATUS:" " $temp_output " | cut -d' :' -f2)
153- echo " DEBUG: HTTP status code: $http_status "
154-
155- rm -f " $temp_output " " $temp_stderr "
156-
157124echo " Request completed successfully in ${elapsed} s (no deadlock)"
158125
159126# Step 6: Verify the import is present in the loaded ontology
0 commit comments