~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix: add server health check with retries for CI registration
LearningCircuitc5cee8acbd7e
diff --git a/tests/ui_tests/auth_helper.js b/tests/ui_tests/auth_helper.jsindex 8e2df2cef7..e4fc5d764b 100644--- a/tests/ui_tests/auth_helper.js+++ b/tests/ui_tests/auth_helper.js@@ -117,6 +117,52 @@ class AuthHelper {return new Promise(resolve => setTimeout(resolve, ms));}+ /**+ * Wait for server to become responsive+ * Uses fetch instead of page navigation to avoid Puppeteer complications+ */+ async _waitForServerReady(maxWaitMs = 120000, checkIntervalMs = 5000) {+ const startTime = Date.now();+ let lastError = null;++ console.log(` Waiting for server to become ready (max ${maxWaitMs/1000}s)...`);++ while (Date.now() - startTime < maxWaitMs) {+ try {+ // Try to fetch the base URL using page.evaluate to make HTTP request+ const response = await this.page.evaluate(async (url) => {+ try {+ const controller = new AbortController();+ const timeoutId = setTimeout(() => controller.abort(), 10000);+ const res = await fetch(url, {+ signal: controller.signal,+ credentials: 'include'+ });+ clearTimeout(timeoutId);+ return { ok: res.ok, status: res.status };+ } catch (e) {+ return { ok: false, error: e.message };+ }+ }, this.baseUrl);++ if (response.ok) {+ console.log(` ✅ Server is ready (status: ${response.status})`);+ return true;+ }++ console.log(` Server response: ${JSON.stringify(response)}`);+ } catch (evalError) {+ lastError = evalError;+ console.log(` Server check error: ${evalError.message}`);+ }++ await this._delay(checkIntervalMs);+ }++ console.log(` Server did not become ready within ${maxWaitMs/1000}s`);+ return false;+ }+/*** Navigate to an auth page with CI-aware retry logic* @param {string} path - The path to navigate to (e.g., AUTH_CONFIG.paths.login)@@ -512,30 +558,44 @@ class AuthHelper {// For timeout errors, fall through to session verification below}- // If navigation didn't clearly succeed, verify via session+ // If navigation didn't clearly succeed, verify via session with retriesif (!registrationSucceeded) {console.log(' Verifying registration via session...');- await this._delay(5000); // Give server time to complete- try {- await this.page.goto(this.baseUrl, {- waitUntil: AUTH_CONFIG.ci.waitUntil,- timeout: AUTH_CONFIG.timeouts.formSelector- });+ // Wait for server to become ready (might be still processing)+ // In CI, registration can take 2+ minutes due to encrypted DB creation+ const serverReady = await this._waitForServerReady(180000, 10000); // 3 min max, check every 10s- const homeUrl = this.page.url();- console.log(` After navigation to home: ${homeUrl}`);+ if (serverReady) {+ // Try to navigate and verify session+ for (let retryAttempt = 1; retryAttempt <= 3; retryAttempt++) {+ console.log(` Session verification attempt ${retryAttempt}/3...`);- if (!homeUrl.includes('/auth/login') && !homeUrl.includes('/auth/register')) {- // Check for logout button as proof of login- const logoutBtn = await this.page.$('#logout-form, a[href*="logout"], .logout');- if (logoutBtn) {- console.log(' ✅ Found logout button - registration succeeded');- registrationSucceeded = true;+ try {+ await this.page.goto(this.baseUrl, {+ waitUntil: AUTH_CONFIG.ci.waitUntil,+ timeout: AUTH_CONFIG.timeouts.formSelector+ });++ const homeUrl = this.page.url();+ console.log(` After navigation to home: ${homeUrl}`);++ if (!homeUrl.includes('/auth/login') && !homeUrl.includes('/auth/register')) {+ // Check for logout button as proof of login+ const logoutBtn = await this.page.$('#logout-form, a[href*="logout"], .logout');+ if (logoutBtn) {+ console.log(' ✅ Found logout button - registration succeeded');+ registrationSucceeded = true;+ break;+ }+ }+ } catch (sessionError) {+ console.log(` Session check attempt ${retryAttempt} failed: ${sessionError.message}`);+ if (retryAttempt < 3) {+ await this._delay(10000); // Wait 10s before retry+ }}}- } catch (sessionError) {- console.log(` Session check failed: ${sessionError.message}`);}}