Copilot commented on code in PR #3229:
URL: https://github.com/apache/apisix-dashboard/pull/3229#discussion_r2434935928


##########
e2e/tests/stream_routes.show-disabled-error.spec.ts:
##########
@@ -67,11 +68,11 @@ const updateAPISIXConf = async (
 
 const restartDockerServices = async () => {
   await execAsync('docker compose restart apisix', { cwd: getE2EServerDir() });
-  const url = 'http://127.0.0.1:6174/ui/';
+  const url = env.E2E_TARGET_URL;
   const maxRetries = 20;
   const interval = 1000;
   for (let i = 0; i < maxRetries; i++) {
-    const res = await fetch(url);
+    const res = await fetch(url).catch(() => ({ ok: false }));

Review Comment:
   The catch handler returns an object that may not match the Response 
interface fully. If subsequent code expects Response methods or properties 
beyond `ok`, this could cause runtime errors. Consider returning a proper 
Response object or checking the type explicitly.
   ```suggestion
       const res = await fetch(url).catch(() => new Response(null, { status: 
503, statusText: 'Service Unavailable' }));
   ```



##########
.github/workflows/e2e.yml:
##########
@@ -72,14 +72,13 @@ jobs:
       - name: Waiting dashboard service to be healthy
         working-directory: ./e2e/server
         run: |
-          E2E_SERVER="dashboard-e2e"
           TIMEOUT=30
           timeout $TIMEOUT bash -c '
-            until [ "$(docker inspect --format="{{.State.Health.Status}}" 
$(docker compose ps -q '$E2E_SERVER'))" = "healthy" ]; do
-              echo "'$E2E_SERVER' is starting..."
+            until curl -f http://127.0.0.1:9180/ui > /dev/null 2>&1; do

Review Comment:
   The health check endpoint should be `/ui/` (with trailing slash) to match 
the URL pattern used in env.ts and the test expectations. Without the trailing 
slash, this may not accurately verify the dashboard is ready.
   ```suggestion
               until curl -f http://127.0.0.1:9180/ui/ > /dev/null 2>&1; do
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to