瀏覽代碼

feat: enhance Squid availability check and logging in installation workflow

Manuel 7 月之前
父節點
當前提交
ad1fb05fbd
共有 1 個文件被更改,包括 22 次插入 和 5 次删除
  1. 22 5
      .github/workflows/test-install.yml

+ 22 - 5
.github/workflows/test-install.yml

@@ -137,13 +137,30 @@ jobs:
         # Iniciar squid
         service squid start || squid
 
-    - name: Generate Squid access log
+    - name: Wait for Squid to become available and generate access log
       run: |
-        # Esperar a que squid esté listo
-        sleep 2
-        
+        for i in $(seq 1 30); do
+          if curl -s --max-time 5 http://127.0.0.1:3128/ > /dev/null 2>&1; then
+            echo "Squid responding on port 3128"
+            break
+          fi
+          echo "Waiting for Squid to start... ($i/30)"
+          sleep 1
+        done
+
+        if ! curl -s --max-time 5 http://127.0.0.1:3128/ > /dev/null 2>&1; then
+          echo "ERROR: Squid failed to start or is not listening on 127.0.0.1:3128"
+          echo "=== Squid process list ==="
+          ps -ef | grep squid | grep -v grep || true
+          echo "=== Squid cache log ==="
+          cat /var/log/squid/cache.log 2>/dev/null || true
+          echo "=== Squid access log ==="
+          cat /var/log/squid/access.log 2>/dev/null || true
+          exit 1
+        fi
+
         # Generar una entrada en el log accediendo a squid
-        curl -s -o /dev/null http://127.0.0.1:3128/ || echo "Squid access logged"
+        curl -s -o /dev/null http://127.0.0.1:3128/ || true
         
         # Verificar que el log existe
         ls -la /var/log/squid/access.log || echo "Log file check"