Skip to content

fix(workbench): skip disabled resource profiles in capacity test#515

Merged
ian-flores merged 2 commits into
mainfrom
fix/workbench-session-capacity-disabled-profile
Jul 22, 2026
Merged

fix(workbench): skip disabled resource profiles in capacity test#515
ian-flores merged 2 commits into
mainfrom
fix/workbench-session-capacity-disabled-profile

Conversation

@samcofer

Copy link
Copy Markdown
Contributor

What

Fixes the test_launch_sessions_with_the_configured_resource_profile[chromium] timeout when a Workbench resource profile is visible but disabled for the authenticated user.

Closes #514

Root cause

Workbench renders resource profiles a user is not entitled to (e.g. a group-restricted profile) as visible [role='option'] elements marked aria-disabled="true" / data-disabled. The capacity test detected every option as launchable, then option.click() on a disabled one blocked until Playwright's 5s timeout:

locator resolved to <div role="option" data-disabled="" aria-disabled="true" ...>
  - element is not enabled - retrying click action
TimeoutError: Locator.click: Timeout 5000ms exceeded.

Fix

  • _option_is_disabled() — new helper checking aria-disabled / data-disabled.
  • _detect_profiles() — now returns each profile's name and disabled flag (instead of a bare name list).
  • Auto-detect (launch_sessions) — launches only enabled profiles; skips the whole scenario with a clear reason only when every profile is disabled (nothing launchable).
  • _launch_session() — checks the resolved option before clicking and raises ResourceProfileDisabled rather than clicking a disabled option. An explicitly configured (workbench.session_profiles) but disabled profile now pytest.skips with a message naming the profile and the likely group/entitlement restriction.

Behavior decisions

Case Behavior
Configured profile disabled for user pytest.skip with reason (environment condition, not a failure)
Auto-detected, some disabled filter out disabled, launch the rest
Auto-detected, all disabled pytest.skip — nothing launchable

Testing

  • ruff check / ruff format --check pass.
  • pytest --collect-only collects cleanly.
  • Product test — cannot run in CI (no Workbench deployment).

🤖 Generated with Claude Code

Workbench renders resource profiles the authenticated user is not
entitled to as visible [role='option'] elements marked
aria-disabled='true' / data-disabled. The capacity test detected every
option as launchable and then clicked it, so Playwright blocked waiting
for the disabled element to become enabled until the 5s timeout blew up.

Detect the disabled state up front:
- _detect_profiles now reports each profile's disabled flag; auto-detect
  filters out disabled profiles and skips the scenario only when every
  profile is disabled (nothing launchable).
- _launch_session checks the resolved option before clicking and raises
  ResourceProfileDisabled instead of clicking a disabled option; an
  explicitly configured but disabled profile skips with a clear reason
  naming the likely group/entitlement restriction.

Fixes #514

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…city twin

Address review feedback on PR #515's disabled-resource-profile handling:

- launch_sessions records a disabled configured profile and continues to the
  remaining profiles instead of aborting the whole scenario on the first one;
  it skips only when nothing was launchable across all profiles.
- Move _option_is_disabled and ResourceProfileDisabled into workbench/conftest.py
  and apply the disabled-option check in test_session_capacity_k8s.py, whose
  diverged copy of _launch_session still hung on disabled options.
- Replace the list[dict[str, object]] profile records with a DetectedProfile
  frozen dataclass, dropping the str() casts and object-typed leakage.
@ian-flores

Copy link
Copy Markdown
Collaborator

Hey Sam. I reviewed #515 and pushed one commit onto your branch (681d2152).

Three things it changes:

  • launch_sessions was bailing on the whole scenario the moment it hit one disabled configured profile. Now it skips just that profile, keeps launching the rest, and only skips the scenario if nothing was launchable.
  • test_session_capacity_k8s.py had its own copy of _launch_session that still clicked disabled options and hung. I pulled _option_is_disabled and ResourceProfileDisabled into conftest.py and wired the check into the k8s file too.
  • The list[dict[str, object]] profile records are now a DetectedProfile frozen dataclass, which drops the str() casts.

@ian-flores
ian-flores merged commit 6f6ea03 into main Jul 22, 2026
35 checks passed
@ian-flores
ian-flores deleted the fix/workbench-session-capacity-disabled-profile branch July 22, 2026 19:01
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-22 19:01 UTC

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(workbench): session capacity test times out on disabled resource profiles

2 participants