[object Object]

← back to AsSeenInMovies

smoke: /api/health perf budget (<500ms) — regression guard for N+1/pool

57d42ae4393cdddad562c2501dfbb47f2681e835 · 2026-05-13 10:59:39 -0700 · SteveStudio2

Files touched

Diff

commit 57d42ae4393cdddad562c2501dfbb47f2681e835
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 10:59:39 2026 -0700

    smoke: /api/health perf budget (<500ms) — regression guard for N+1/pool
---
 test/smoke.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/test/smoke.js b/test/smoke.js
index 5bb8e05..7eea321 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -113,11 +113,17 @@ function check(name, cond, hint = '') {
   check('api: 200',            r.status === 200);
   check('api: discovery doc',  /endpoints/.test(r.body) && /AsSeenInMovies API/.test(r.body));
 
-  // 10b. /api/health
-  r = await fetch('/api/health');
-  check('api/health: 200',         r.status === 200);
-  check('api/health: ok',          /"ok":true/.test(r.body));
-  check('api/health: uptime_s',    /"uptime_s":\d+/.test(r.body));
+  // 10b. /api/health — perf budget enforced (500ms generous ceiling that catches
+  // accidental N+1 queries / pool exhaustion sneaking back in)
+  {
+    const t0 = Date.now();
+    r = await fetch('/api/health');
+    const ms = Date.now() - t0;
+    check('api/health: 200',         r.status === 200);
+    check('api/health: ok',          /"ok":true/.test(r.body));
+    check('api/health: uptime_s',    /"uptime_s":\d+/.test(r.body));
+    check('api/health: <500ms',      ms < 500, `actual ${ms}ms`);
+  }
 
   // 10c. /api/version — deploy fingerprint
   r = await fetch('/api/version');

← 755754e Makefile: add fleet-status target  ·  back to AsSeenInMovies  ·  Makefile: add help target listing all available commands ed68d9d →