test(ui): raise vitest test and hook timeouts for CI headroom (#37370)

* test(ui): raise vitest test and hook timeouts for CI headroom

The UI unit suite runs about 3x slower on the CI runner than locally, which
put the slowest cases right on the 30s per-test limit. TeamInfo's pass
through routes case takes ~8s locally and has been failing on staging at the
timeout across consecutive runs even though it passes reliably when run
directly.

Raise testTimeout to 60s and set hookTimeout to 30s so the current slow cases
have headroom. This is a stopgap while the suite gets split into proper tiers,
not a fix for the underlying per-test cost.

* test(ui): query agent form panels with findByRole like the rest of the file

The panel helper was the only synchronous query in add_agent_form's
integration test; every other lookup already retries via findBy. On the CI
runner the second case has been failing with "Unable to find an accessible
element with the role button and name /Cost Configuration/" against a modal
whose body had not rendered.

Make the helper retry like its siblings and await it at each call site.
This commit is contained in:
yuneng-jiang 2026-08-18 15:41:16 -07:00 committed by GitHub
parent eef41c9987
commit 657ded533c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 13 deletions

View file

@ -49,7 +49,7 @@ const langgraphInfo: AgentCreateInfo = {
const renderForm = () =>
render(<AddAgentForm visible={true} onClose={vi.fn()} accessToken="tok" onSuccess={vi.fn()} />);
const panel = (name: RegExp) => screen.getByRole("button", { name });
const panel = (name: RegExp) => screen.findByRole("button", { name });
const openAgentTypeMenu = async (user: ReturnType<typeof userEvent.setup>) => {
await user.click(screen.getAllByRole("combobox")[0]);
@ -102,7 +102,7 @@ describe("AddAgentForm submit payload", () => {
await user.clear(screen.getByLabelText("Version"));
await user.type(screen.getByLabelText("Version"), "2.0.0");
await user.click(panel(/Skills/));
await user.click(await panel(/Skills/));
await user.click(screen.getByRole("button", { name: /Add Skill/ }));
await user.type(await screen.findByLabelText("Skill ID"), "hello");
await user.type(screen.getByLabelText("Skill Name"), "Hello");
@ -111,22 +111,22 @@ describe("AddAgentForm submit payload", () => {
await user.type(screen.getByLabelText("Examples"), "say hi");
await user.click(screen.getByLabelText("Agent Name"));
await user.click(panel(/Capabilities/));
await user.click(await panel(/Capabilities/));
await user.click(await screen.findByRole("switch", { name: "Streaming" }));
await user.click(screen.getByRole("switch", { name: "Push Notifications" }));
await user.click(panel(/Optional Settings/));
await user.click(await panel(/Optional Settings/));
await user.type(await screen.findByLabelText("Icon URL"), "https://example.com/icon.png");
await user.click(panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
await user.type(await screen.findByLabelText("Cost Per Query ($)"), "0.25");
await user.type(screen.getByLabelText("Input Cost Per Token ($)"), "0.000002");
await user.click(panel(/LiteLLM Parameters/));
await user.click(await panel(/LiteLLM Parameters/));
await user.type(await screen.findByLabelText("Model (Optional)"), "gpt-4o");
await user.click(screen.getByRole("switch", { name: "Make Public" }));
await user.click(panel(/Authentication Headers/));
await user.click(await panel(/Authentication Headers/));
await user.click(await screen.findByRole("button", { name: /Add Static Header/ }));
await user.type(await screen.findByPlaceholderText("Header name (e.g. Authorization)"), "X-Tenant");
await user.type(screen.getByPlaceholderText("Value (e.g. Bearer token123)"), "acme");
@ -176,9 +176,9 @@ describe("AddAgentForm submit payload", () => {
await user.type(screen.getByLabelText("Display Name"), "Collapsed");
await user.type(screen.getByPlaceholderText("Describe what this agent does..."), "d");
await user.click(panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
await user.type(await screen.findByLabelText("Cost Per Query ($)"), "0.75");
await user.click(panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
await goToLastStepAndCreate(user);
@ -189,10 +189,10 @@ describe("AddAgentForm submit payload", () => {
const user = userEvent.setup({ pointerEventsCheck: PointerEventsCheckLevel.Never });
renderForm();
await user.click(panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
await user.type(await screen.findByLabelText("Cost Per Query ($)"), "0.75");
await user.click(panel(/Cost Configuration/));
await user.click(panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
await user.click(await panel(/Cost Configuration/));
expect(await screen.findByLabelText("Cost Per Query ($)")).toHaveValue(0.75);
});

View file

@ -19,7 +19,8 @@ const config: ViteUserConfig = {
setupFiles: ["tests/setupTests.ts"],
globals: true,
css: true, // lets you import CSS/modules without extra mocks
testTimeout: 30000,
testTimeout: 60000,
hookTimeout: 30000,
silent: process.env.CI ? "passed-only" : false,
teardownTimeout: 60000,
coverage: {