Skip to content

fix(#3544): make model selector test resilient to VLLM outages - #3545

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
release-1.10from
agent/3544-dynamic-model-selector
Open

fix(#3544): make model selector test resilient to VLLM outages#3545
fullsend-ai-coder[bot] wants to merge 1 commit into
release-1.10from
agent/3544-dynamic-model-selector

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Replace the hardcoded aria snapshot assertion in the model selector test with a dynamic check that queries /api/lightspeed/v1/models to discover which models are actually registered. The VLLM provider endpoint is external and can intermittently return HTTP 503, preventing the redhataillama model from being registered while the 4 OpenAI models remain available.

The test now fetches the models API to get the current list of LLM models, asserts at least 4 models are available (the OpenAI baseline), builds the expected aria snapshot dynamically from the API response, and uses page.getByRole("menu") instead of page.locator("body") for a more targeted assertion.


Closes #3544

Post-script verification

  • Branch is not main/master (agent/3544-dynamic-model-selector)
  • Secret scan passed (gitleaks — e5b55e10cdf003048a1e38977687ed76a47e2026..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Replace the hardcoded aria snapshot assertion in the model selector
test with a dynamic check that queries /api/lightspeed/v1/models to
discover which models are actually registered. The VLLM provider
endpoint is external and can intermittently return HTTP 503,
preventing the redhataillama model from being registered while the
4 OpenAI models remain available.

The test now fetches the models API to get the current list of LLM
models, asserts at least 4 models are available (the OpenAI
baseline), builds the expected aria snapshot dynamically from the
API response, and uses page.getByRole("menu") instead of
page.locator("body") for a more targeted assertion.

Closes #3544
@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

Hi @fullsend-ai-coder[bot]. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:12 AM UTC · Completed 10:25 AM UTC

Commit: 3d40357 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.28

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [edge-case] workspaces/lightspeed/e2e-tests/tests/specs/lightspeed.spec.ts:205 — The sort order of availableModels uses JavaScript's default lexicographic .sort(), assuming the dropdown UI sorts identically. The original hardcoded list was already in this order, so the assumption holds for current model names. If model names with different casing or special characters are introduced, the snapshot assertion could fail — but this would surface as a clear test failure, not a silent correctness issue.

  • [error-handling] workspaces/lightspeed/e2e-tests/tests/specs/lightspeed.spec.ts:196 — The API response body is cast via as { type: string; id: string }[] without runtime validation. If the API returns an unexpected shape, a TypeError would surface rather than a descriptive assertion failure. Acceptable in test code — noted for awareness.

  • [test-adequacy] workspaces/lightspeed/e2e-tests/tests/specs/lightspeed.spec.ts:207selectChatModel(page, "gpt-4o-mini") remains hardcoded, assuming this model is always available. The earlier toBeGreaterThanOrEqual(4) assertion would catch OpenAI provider outages first, and this model is from the stable baseline. Consistent with original code.

.sort();

// At least the 4 OpenAI models must always be registered.
expect(availableModels.length).toBeGreaterThanOrEqual(4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] edge-case

The sort order of availableModels uses JavaScript's default lexicographic .sort(), assuming the dropdown UI sorts identically. The original hardcoded list was already in this order, so the assumption holds for current model names. If model names with different casing or special characters are introduced, the snapshot assertion could fail — but this would surface as a clear test failure, not a silent correctness issue.

"/api/lightspeed/v1/models",
);
expect(modelsResponse.ok()).toBe(true);
const modelsData = await modelsResponse.json();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] error-handling

The API response body is cast via as { type: string; id: string }[] without runtime validation. If the API returns an unexpected shape, a TypeError would surface rather than a descriptive assertion failure. Acceptable in test code.

// At least the 4 OpenAI models must always be registered.
expect(availableModels.length).toBeGreaterThanOrEqual(4);

await dropdown.click();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] test-adequacy

selectChatModel(page, "gpt-4o-mini") remains hardcoded, assuming this model is always available. The earlier toBeGreaterThanOrEqual(4) assertion would catch OpenAI provider outages first, and this model is from the stable baseline.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Sep 3, 2026
@subhashkhileri

Copy link
Copy Markdown
Member

/ok-to-test

@subhashkhileri

Copy link
Copy Markdown
Member

/test ?

@subhashkhileri

Copy link
Copy Markdown
Member

/test e2e-ocp-helm-nightly-pr-scoped

@subhashkhileri

Copy link
Copy Markdown
Member

/test e2e-ocp-helm-nightly

@rhdh-test-bot

Copy link
Copy Markdown

❌ Failed Nightly E2E Tests

Platform: ocp 4.20 | RHDH Version: 1.10 | Duration: 41m 15s
Passed: 208 | Failed: 2 | Flaky: 0 | Skipped: 30
Playwright Report | Build Log | Logs | Artifacts

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

@fullsend-ai-coder[bot]: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ocp-helm-nightly 3d40357 link false /test e2e-ocp-helm-nightly

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-diagnose Triggers the fullsend ci-diagnose agent ok-to-test ready-for-merge All reviewers approved — ready to merge release-branch-patch PR modifies workspace on a release branch workspace-update PR modifies files in an existing workspace

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants