Skip to content

studio: fix tests turning main CI red/flaky (kill-process, install overrides, UI re-login) - #6419

Merged
danielhanchen merged 3 commits into
mainfrom
fix-llama-stats-logger-kill-test
Jun 18, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fix-llama-stats-logger-kill-test

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Summary

main CI is red/flaky from three tests left behind by the recent merge wave (#6377, #6400, #6405). None is a real product regression; each tests removed/old behavior or races a navigation. This PR makes the affected jobs green.

1. Repo tests (CPU) / Python matrix: test_kill_process_records_timestamp_on_actual_kill

AttributeError: 'LlamaCppBackend' object has no attribute '_stats_logger'. #6377 added a self._stats_logger cleanup to _kill_process()'s finally; #6400's test builds the backend via LlamaCppBackend.__new__(...), bypassing __init__ where _stats_logger is set. Fix: set _stats_logger on the hand-built backend, alongside the other attributes it already seeds. Production code unchanged.

2. Repo tests (CPU): test_normal_linux_includes_overrides

overrides.txt should be called on normal Linux. #6400 moved the torchao override from a fixed pin in overrides.txt to a torch-matched spec installed via --force-reinstall (_select_torchao_spec), leaving overrides.txt as a comment-only pointer. It updated the Windows variant to assert --reinstall but not the Linux one. Fix: assert the override step (--reinstall) on Linux too, matching the Windows test and the real install behavior.

3. Chat UI Tests: flaky net::ERR_ABORTED on /login

The Shutdown step re-logs in after a CLI password rotation that revoked the prior token. The SPA auth guard can client-side-redirect mid-navigation against the stale token, aborting page.goto("/login") with net::ERR_ABORTED (a race; passes on main most of the time). Fix: resolve on domcontentloaded and tolerate the abort, relying on the password-field wait that follows to confirm /login (matching the wait_until other navigations in this file already use).

Verification

tests/python/test_no_torch_filtering.py                      -> 51 passed
studio/backend/tests/test_llama_cpp_wait_for_vram_settle.py  -> 16 passed
python -m py_compile tests/studio/playwright_chat_ui.py       -> ok

The Chat UI script is a full live-Studio + browser e2e flow, so the navigation change is verified by py_compile and the standard Playwright robustness pattern rather than a local run.

#6377 added a self._stats_logger cleanup step to _kill_process's finally block.
test_kill_process_records_timestamp_on_actual_kill (added in #6400) builds the
backend via __new__, which bypasses __init__ where _stats_logger is set, so once
both landed on main the test raised AttributeError: 'LlamaCppBackend' object has
no attribute '_stats_logger'. Set _stats_logger on the hand-built backend,
mirroring __init__, so the kill path's finally has the attribute it expects.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the test setup in test_llama_cpp_wait_for_vram_settle.py by initializing backend._stats_logger to None to prevent errors when _kill_process attempts to stop it in its finally block. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

#6400 moved the torchao dependency override from a fixed pin in overrides.txt to
a torch-matched spec installed via --force-reinstall (_select_torchao_spec), and
turned overrides.txt into a comment-only pointer. It updated the Windows variant
(test_windows_only_includes_overrides) to check for --reinstall, but left
test_normal_linux_includes_overrides asserting overrides.txt is installed, which
no longer happens. Check for the override step (--reinstall) instead, matching
the Windows test.
@danielhanchen danielhanchen changed the title studio: fix red main from _stats_logger AttributeError in kill-process test studio: fix two stale tests turning main red (kill-process _stats_logger + install overrides) Jun 18, 2026
The Shutdown step re-logs in after a CLI password rotation that revoked the prior
token. The SPA auth guard can client-side-redirect mid-navigation against the
stale token, aborting page.goto("/login") with net::ERR_ABORTED. It is a race
(passes on main most of the time). Resolve on domcontentloaded and tolerate the
abort, relying on the password-field wait that follows to confirm we reached
/login, matching the wait_until used by the other navigations in this file.
@danielhanchen danielhanchen changed the title studio: fix two stale tests turning main red (kill-process _stats_logger + install overrides) studio: fix tests turning main CI red/flaky (kill-process, install overrides, UI re-login) Jun 18, 2026
@danielhanchen
danielhanchen merged commit 79b57fe into main Jun 18, 2026
31 checks passed
@danielhanchen
danielhanchen deleted the fix-llama-stats-logger-kill-test branch June 18, 2026 05:30
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.

1 participant