Skip to content

Commit a6cc1d3

Browse files
bpamiriclaude
andcommitted
fix(ci): separate reload request from test request to handle 302 redirect
Wheels returns HTTP 302 after reload=true completes. The test curl was capturing this 302 as a failure instead of following the redirect. Fix: issue the reload as a separate curl with -L (follow redirects), then run the actual test request without reload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 389cc11 commit a6cc1d3

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,19 @@ jobs:
224224
225225
# Use format=json WITHOUT only=failure,error to get clean, full JSON
226226
# (the only= param produces text output, not parseable JSON)
227-
RELOAD_URL="${BASE_URL}?db=${db}&reload=true&format=json"
228227
JSON_URL="${BASE_URL}?db=${db}&format=json"
229228
230229
RESULT_FILE="/tmp/test-results/${{ matrix.cfengine }}-${db}-result.txt"
231230
JUNIT_FILE="/tmp/junit-results/${{ matrix.cfengine }}-${db}-junit.xml"
232231
233-
# Run tests with reload (clears model cache for clean DB switch)
232+
# Trigger Wheels reload to clear model cache for clean DB switch.
233+
# reload=true causes a 302 redirect, so we follow redirects and
234+
# discard output — we only care that it completes successfully.
235+
echo "Triggering Wheels reload for ${db}..."
236+
curl -s -L -o /dev/null --max-time 120 \
237+
"${BASE_URL}?db=${db}&reload=true" || echo "Reload request returned non-zero (non-fatal)"
238+
239+
# Now run the actual test suite (no reload)
234240
MAX_RETRIES=3
235241
RETRY_COUNT=0
236242
HTTP_CODE="000"
@@ -239,17 +245,10 @@ jobs:
239245
RETRY_COUNT=$((RETRY_COUNT + 1))
240246
echo "Test attempt ${RETRY_COUNT} of ${MAX_RETRIES}..."
241247
242-
# Use reload URL on first attempt, plain URL on retries
243-
if [ "$RETRY_COUNT" -eq 1 ]; then
244-
TEST_URL="$RELOAD_URL"
245-
else
246-
TEST_URL="$JSON_URL"
247-
fi
248-
249248
HTTP_CODE=$(curl -s -o "$RESULT_FILE" \
250249
--max-time 900 \
251250
--write-out "%{http_code}" \
252-
"$TEST_URL" || echo "000")
251+
"$JSON_URL" || echo "000")
253252
254253
echo "HTTP Code: ${HTTP_CODE}"
255254

0 commit comments

Comments
 (0)