From 6845ced98f5e4b1ac4a73c2c20a480692f7a54a8 Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 30 Mar 2026 00:00:46 +0000 Subject: [PATCH] Enable pre-warm cache + faster Playwright config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore page pre-warming at HTTP server startup (was skipped) and increase render workers from 2→4. Tighten Playwright timeouts and run 3 workers in parallel for faster test runs. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/sx_server.ml | 9 ++++++--- tests/playwright/playwright.config.js | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hosts/ocaml/bin/sx_server.ml b/hosts/ocaml/bin/sx_server.ml index 93f6aff2..8f1b2b18 100644 --- a/hosts/ocaml/bin/sx_server.ml +++ b/hosts/ocaml/bin/sx_server.ml @@ -2044,8 +2044,11 @@ let http_mode port = "/sx/(language)"; "/sx/(applications)"; "/sx/(geography.(reactive))"; "/sx/(geography.(hypermedia))"; ] in - ignore cache_response; - Printf.eprintf "[sx-http] Skipping pre-warm (render on demand)\n%!"; + let t_warm = Unix.gettimeofday () in + List.iter cache_response _warmup_paths; + let n_cached = Hashtbl.length response_cache in + Printf.eprintf "[sx-http] Pre-warmed %d pages in %.3fs\n%!" + n_cached (Unix.gettimeofday () -. t_warm); (* Write full response to a socket *) let write_response client response = @@ -2080,7 +2083,7 @@ let http_mode port = - Cache misses: queued to render workers (domain pool) - Never blocks on rendering — accept loop always responsive *) - let n_workers = max 2 (Domain.recommended_domain_count ()) in + let n_workers = max 4 (Domain.recommended_domain_count ()) in (* Render queue: for cache misses that need full page render *) let render_queue : (Unix.file_descr * string) list ref = ref [] in diff --git a/tests/playwright/playwright.config.js b/tests/playwright/playwright.config.js index 105af1a3..95755db9 100644 --- a/tests/playwright/playwright.config.js +++ b/tests/playwright/playwright.config.js @@ -4,12 +4,13 @@ const { defineConfig } = require('playwright/test'); module.exports = defineConfig({ testDir: __dirname, testMatch: '*.spec.js', - timeout: 60000, + timeout: 30000, retries: 0, - workers: 1, + workers: 3, use: { baseURL: process.env.SX_TEST_URL || 'http://localhost:8013', headless: true, + actionTimeout: 10000, }, projects: [ { name: 'chromium', use: { browserName: 'chromium' } },