🧪 test: Close Three Timing Gaps Behind Intermittent Mock E2E Failures (#18067)
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Backend Unit Tests / backend (push) Blocked by required conditions
Channel Gateway / gateway (push) Waiting to run
Codegraph E2E Vote Gate / Gate (push) Waiting to run
Codegraph E2E Votes / vote (shard 1/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 10/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 2/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 3/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 4/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 5/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 6/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 7/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 8/10) (push) Waiting to run
Codegraph E2E Votes / vote (shard 9/10) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
Frontend Unit Tests / Client build recovery regression (push) Waiting to run
Frontend Unit Tests / Codegraph select (push) Waiting to run
Frontend Unit Tests / Build packages (push) Waiting to run
Frontend Unit Tests / TypeScript type checks (client) (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/chat (push) Blocked by required conditions
Frontend Unit Tests / Tests: @librechat/client (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 1/2) (push) Blocked by required conditions
Frontend Unit Tests / Tests: Ubuntu (shard 2/2) (push) Blocked by required conditions
Frontend Unit Tests / Vite build verification (push) Blocked by required conditions
Frontend Unit Tests / frontend (push) Blocked by required conditions
Playwright E2E Tests / Codegraph select (push) Waiting to run
Playwright E2E Tests / e2e () (push) Blocked by required conditions
Playwright E2E Tests / MCP list_changed (replica count 1) (push) Blocked by required conditions
Playwright E2E Tests / MCP list_changed (replica count 2) (push) Blocked by required conditions
Playwright E2E Tests / MCP Apps (browser and server) (push) Waiting to run
Playwright E2E Tests / e2e (push) Blocked by required conditions
Main Promotion Policy Tests / Main promotion denial and fast-forward tests (push) Waiting to run

* 👋 test: Wait for the Header Selector Before Counting Agent Names on the Greeting Landing

The greeting scenario read how many header controls named the agent with a
one-shot `count()` and then expected the same number of mentions inside
`main`. The header selector takes the agent's name after the welcome screen
paints, so when the name landed between those two reads the first said 0 and
the second saw the selector's own label, which sits inside `main`. When both
reads ran before the name landed the check passed without the selector ever
naming the agent.

Wait for the selector to show the name, then expect that label to be the only
mention inside `main`.

* 🗂️ test: Keep the Sidebar Open When Chat History Is Already Showing

On desktop `openChatHistory` clicked the Chat History rail button
unconditionally. The rail button of the panel already showing collapses the
sidebar, and Chat History is the panel every document starts on, so after the
reload in the subagent activity scenario the helper closed the conversation
list it was meant to show. The assertions that follow only passed while the
list was still mounted during the collapse.

Open the sidebar first on both layouts and press the rail button only when
another panel is showing, the guard `openPanel` already uses.

* 🚦 test: Hold the Mock Suite Until the Server Reports Ready

Playwright starts the suite once the base URL answers, which the server does
as soon as it listens. It keeps initializing after that and refuses chat
starts and schedule writes with a 503 until `/readyz` turns 200, so a spec
that runs first against a slow start got `SCHEDULES_NOT_READY`. The
two-replica wrapper already waits on `/readyz` before exposing its proxy; the
single-process server had no such gate.

Poll `/readyz` in global setup before authenticating.
This commit is contained in:
Danny Avila 2026-11-11 17:54:25 -05:00 • committed by GitHub
parent 2150a9b437
commit 0fdabfe283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 54 additions and 8 deletions

View file

@ -1,8 +1,10 @@
import { FullConfig } from '@playwright/test';
import { waitForReadiness } from './readiness';
import authenticate from './authenticate';
import { getE2EUser } from './user';
async function globalSetup(config: FullConfig) {
await waitForReadiness(config);
await authenticate(config, getE2EUser());
}

39
e2e/setup/readiness.ts Normal file
View file

@ -0,0 +1,39 @@
import { expect, request } from '@playwright/test';
import type { FullConfig } from '@playwright/test';
/** The same budget the profiles give the server to start listening. */
const READINESS_TIMEOUT_MS = 120_000;
/**
* Holds the run until the app reports ready. Playwright starts the suite once the base URL
* answers, which the server does as soon as it listens; it then finishes initializing (MCP
* servers, migrations, the trigger and schedule engines) and refuses chat starts and schedule
* writes with a 503 until `/readyz` turns 200. The two-replica wrapper already waits for that
* before exposing its proxy, and this gives the single-process server the same ordering.
*/
export async function waitForReadiness(config: FullConfig): Promise<void> {
const { baseURL } = config.projects[0].use;
if (typeof baseURL !== 'string') {
throw new Error('🤖: baseURL is not defined');
}
const readyz = new URL('/readyz', baseURL).toString();
const api = await request.newContext({ ignoreHTTPSErrors: true });
try {
await expect
.poll(
() =>
api.get(readyz, { timeout: 5_000 }).then(
(response) => response.status(),
() => 0,
),
{
message: `${readyz} must report ready before the first spec runs`,
timeout: READINESS_TIMEOUT_MS,
intervals: [100, 250, 500],
},
)
.toBe(200);
} finally {
await api.dispose();
}
}

View file

@ -125,12 +125,12 @@ test.describe('welcome screen heading and footer', () => {
await expect(page.getByText(DISCLAIMER)).toHaveCount(0);
/** No footer beneath it, so the composer keeps only its shadow clearance. */
await expect.poll(() => composerClearance(page)).toBe(16);
/** The header selector still names the agent; the welcome screen does not repeat it. */
const inSelector = await page
.locator('button, [role="combobox"]')
.getByText(name, { exact: true })
.count();
await expect(main.getByText(name, { exact: true })).toHaveCount(inSelector);
/** The header selector follows the conversation on a short delay, so it names the agent a
* beat after the welcome screen paints. Once it does, that label is the only mention. */
await expect(main.getByRole('button', { name: 'Select a model', exact: true })).toHaveText(
name,
);
await expect(main.getByText(name, { exact: true })).toHaveCount(1);
} finally {
await cleanupAgent(page, agentId);
}

View file

@ -64,12 +64,17 @@ const NARROW_MAX_WIDTH = 768;
* builder, say) may have replaced.
*/
export async function openChatHistory(page: Page) {
await openSidebar(page);
const narrow = (page.viewportSize()?.width ?? Infinity) <= NARROW_MAX_WIDTH;
if (!narrow) {
await page.getByRole('button', { name: 'Chat History' }).click();
/* The rail button of the panel already showing collapses the sidebar, so it is pressed
only to switch panels. */
const trigger = page.getByRole('button', { name: 'Chat History' });
if ((await trigger.getAttribute('aria-pressed')) !== 'true') {
await trigger.click();
}
return;
}
await openSidebar(page);
const switcher = page.getByTestId('panel-switcher-button');
if (!(await switcher.textContent())?.includes('Chat History')) {
await switcher.click();