[object Object]

← back to Wallco Ai

marketplace ai tests: 5×8s retry budget to ride out parallel-agent pm2 reloads

53a5430c9ef2c2cab30639db43bf06f1b8c5985c · 2026-05-13 15:35:26 -0700 · SteveStudio2

Files touched

Diff

commit 53a5430c9ef2c2cab30639db43bf06f1b8c5985c
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 15:35:26 2026 -0700

    marketplace ai tests: 5×8s retry budget to ride out parallel-agent pm2 reloads
---
 tests/marketplace/ai-text.test.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/marketplace/ai-text.test.js b/tests/marketplace/ai-text.test.js
index a22e7cc..d4b22b4 100644
--- a/tests/marketplace/ai-text.test.js
+++ b/tests/marketplace/ai-text.test.js
@@ -44,17 +44,19 @@ function rawReq(method, path, body, { timeoutMs = 15_000 } = {}) {
   });
 }
 
-// Parallel YOLO-loop agents reload pm2 mid-test, so transient ECONNREFUSED /
-// socket-hang-up is expected. Retry up to 3 times with a 5s settle wait.
+// Parallel YOLO-loop agents reload pm2 mid-test (wallco-ai restarts every few
+// minutes overnight), so transient ECONNREFUSED / socket-hang-up is expected.
+// Retry up to 5 times with an 8s settle wait — long enough to ride out a
+// pm2 reload cycle even when the reload lands mid-qwen3-call.
 async function req(method, path, body, opts) {
   let lastErr;
-  for (let attempt = 0; attempt < 3; attempt++) {
+  for (let attempt = 0; attempt < 5; attempt++) {
     try { return await rawReq(method, path, body, opts); }
     catch (err) {
       lastErr = err;
       const transient = /ECONNREFUSED|socket hang up|ECONNRESET|http timeout/i.test(err.message);
       if (!transient) throw err;
-      await new Promise(r => setTimeout(r, 5000));
+      await new Promise(r => setTimeout(r, 8000));
     }
   }
   throw lastErr;

← d9bcbb0 nav: pin marketplace + wallco.ai menu bars to top of viewpor  ·  back to Wallco Ai  ·  wallco: gucci brand-reference viewer + fliepaper-bugs spec.j e916bd4 →