#2499·mcp-use

ci: Test with Deno (PR Preview) hangs for 18m and fails with 408 Request Timeout on esm.sh

Author: rohith500Created Sep 9, 2026Updated Sep 14, 2026
LabelsbugreadyTypeScriptserverdependenciesv2mcp-use/mcp-use

Describe the bug

In .github/workflows/typescript-pr-preview.yml, the Test with Deno (PR Preview) job frequently hangs for ~18 minutes and fails across PRs (e.g. #2488, #2498, and Dependabot PRs) due to an external 408 Request Timeout on esm.sh when attempting to fetch the ephemeral preview package published to pkg.pr.new.

Even when all 34 core test suites (TypeScript Conformance Tests v2, TypeDoc validation, unit/integration test suites on Ubuntu and Windows, Knip, lint, build, changesets) pass 100% green, the overall PR check status is marked with a red failure because of this external third-party CDN timeout.


Evidence across Recent PRs & Workflow Runs

  1. PR #2488 (Run 34364889325 & Run 34368728244):
    • 34 of 35 checks passed.
    • Test with Deno (PR Preview) hung for 17m 51s and failed with 408 Request Timeout.
  2. PR #2498 (Run 34370061707):
    • Core maintainer PR faced the same 18-minute hang in Wait for esm.sh to pick up the package.
  3. Dependabot PRs (Run 34337582315):
    • Failed with the same preview package fetch timeout.

Failure Log:

Waiting for esm.sh to pick up the preview package...
Checking URLs:
  PR URL: https://esm.sh/pr/mcp-use/mcp-use@2488
  Commit URL: https://esm.sh/pr/mcp-use/mcp-use@fe032de
Waiting for packages... (attempt 1/10, PR: false, Commit: false)
...
Waiting for packages... (attempt 10/10, PR: false, Commit: false)
⚠️ Packages didn't become fully available after 10 attempts (5 minutes)
  PR URL ready: false
  Commit URL ready: false
Proceeding with tests anyway...

Pre-caching Deno dependencies to avoid download timeouts during tests...
Cache attempt 1/3...
...
⚠️ Failed to cache after 3 attempts
Proceeding with tests anyway - they may download dependencies on demand...

Running Deno tests against PR #2488 preview packages...
Download https://esm.sh/pr/mcp-use/mcp-use@fe032de?no-dts&external=zod

error: Import 'https://esm.sh/pr/mcp-use/mcp-use@fe032de?no-dts&external=zod' failed: 408 Request Timeout
    at file:///home/runner/work/mcp-use/mcp-use/libraries/typescript/packages/server/tests/deno/basic-server.test.ts:1:27

##[error]Process completed with exit code 1.

Root Cause Analysis

  1. curl -s -f -I sends HEAD requests: In .github/workflows/typescript-pr-preview.yml:123:
    bash
    if curl -s -f -I "$PR_URL" > /dev/null 2>&1; then
    The -I flag issues an HTTP HEAD request. esm.sh does not trigger background compilation on HEAD requests, so the polling loop loops for 5 minutes without ever starting the build worker.
  2. On-Demand Bundler Timeout: When deno test subsequently initiates an HTTP GET for https://esm.sh/pr/mcp-use/mcp-use@<hash>?no-dts&external=zod, esm.sh attempts a cold build of the multi-package mcp-use bundle. This cold build frequently exceeds the 30-second gateway timeout, returning 408 Request Timeout.
  3. No continue-on-error: true on Advisory Preview Tests: Testing preview packages published to ephemeral 3rd-party CDNs is an advisory/preview smoke check. When an external CDN times out, it should not fail the overall pull request status check when all unit, integration, and conformance tests pass.
  4. Missing Graceful Fallback: When the 5-minute polling loop times out and packages are marked PR: false, Commit: false, the script logs Proceeding with tests anyway... and runs deno test, which is guaranteed to fail immediately.

Expected behavior

  • Advisory PR preview tests on external CDNs should not fail PR status checks when the external CDN times out or experiences high queue latency.
  • The polling step should use GET to actually warm/trigger the esm.sh build worker.
  • If packages do not become available after the retry timeout, the job should skip deno test gracefully rather than exiting with code 1.

Proposed Fix

In .github/workflows/typescript-pr-preview.yml:

diff
   deno-test:
     name: Test with Deno (PR Preview)
     runs-on: ubuntu-latest
     needs: preview
+    continue-on-error: true
     steps:
       ...
       - name: Wait for esm.sh to pick up the package
         run: |
           ...
           while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
             if [ "$PR_READY" = false ]; then
-              if curl -s -f -I "$PR_URL" > /dev/null 2>&1; then
+              if curl -s -f -r 0-0 "$PR_URL" > /dev/null 2>&1; then
                 echo "✅ PR URL is available"
                 PR_READY=true
               fi
             fi
             if [ "$COMMIT_READY" = false ]; then
-              if curl -s -f -I "$COMMIT_URL" > /dev/null 2>&1; then
+              if curl -s -f -r 0-0 "$COMMIT_URL" > /dev/null 2>&1; then
                 echo "✅ Commit URL is available"
                 COMMIT_READY=true
               fi
             fi
             ...
           done
+          echo "ready=$([ "$PR_READY" = true ] && [ "$COMMIT_READY" = true ] && echo "true" || echo "false")" >> $GITHUB_ENV
+
+      - name: Cache Deno Dependencies
+        if: env.ready == 'true'
+        ...
+      - name: Run Deno Tests
+        if: env.ready == 'true'
+        ...