Skip to content

Stabilize Studio regression tests - #7192

Merged
danielhanchen merged 2 commits into
mainfrom
agent/stabilize-studio-regression-tests
Jul 18, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
agent/stabilize-studio-regression-tests

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Summary

  • Match the sidebar account block by stable class membership instead of utility order.
  • Hold the old watchdog thread with an event while verifying that a replacement process gets a new watchdog.

Root cause

The sidebar test encoded an obsolete class order. The component still uses leading-tight, but additional layout utilities made the ordered regular expression miss the account block.

The watchdog test replaced the watched process and then asserted that the old thread was still alive. The old thread is expected to exit after that replacement, so the assertion raced with correct production behavior.

Impact

This is test-only. Production behavior is unchanged. The regression guards still fail when the account block loses leading-tight or when a replacement process does not receive its own watchdog.

Validation

  • Full watchdog module: 30 passed on Python 3.10, 3.11, 3.12, and 3.13.
  • Formerly flaky watchdog case: 100 consecutive iterations passed on each Python version.
  • Text descender regression module: 3 passed.
  • Sidebar matcher mutation checks covered reordered utilities, wrong leading, missing leading, and missing account identity.
  • Pre-commit hooks passed for both changed files.

@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 refactors two test files to improve robustness. In test_training_stop_watchdog.py, the test test_new_run_gets_its_own_watchdog is updated to use a mocked blocked watchdog loop with a threading.Event and _wait_until assertions, ensuring more reliable synchronization during concurrent test execution. In test_studio_text_descender_clipping.py, the test_sidebar_account_block_uses_leading_tight test is refactored to parse and match HTML class names using set operations rather than a strict regular expression, making the test resilient to changes in class ordering. There are no review comments, and 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.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a452e4a8cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Jul 17, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Jul 17, 2026
@danielhanchen

Copy link
Copy Markdown
Member

Synced this branch with main. #6647 landed the sidebar descender fix (a tolerant regex) and relocated model-selector.tsx into features/model-picker, which touched the same test and conflicted with this branch. I took main's version of test_studio_text_descender_clipping.py so the model-selector path stays correct and we do not carry two competing sidebar matchers. The watchdog replacement-race fix is kept here, so the net diff versus main is now just test_training_stop_watchdog.py.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ebbb115efa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

watched_job_id = None,
):
started.append(target_proc)
release.wait(timeout = 5)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Keep the blocked watchdog alive past the poll window

On a slow or heavily loaded CI worker, this 5-second timeout can expire before the replacement watchdog thread is scheduled and before the later _wait_until(..., timeout=5.0)/first_wd.is_alive() assertions run, so the test can fail even though _start_stop_watchdog correctly created a new watcher. Since the event is released in the finally block, the fake watchdog should either wait indefinitely after the test enters cleanup coverage or use a timeout comfortably longer than the assertion polling windows.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixed in baff5c1. The stub now waits on the release event with no timeout, so the superseded watchdog stays alive until the finally releases it regardless of scheduler load; the is_alive assertion no longer depends on a timeout beating the poll windows. The thread is a daemon, so a release missed on a pre-cleanup abort cannot block process exit.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Jul 17, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: baff5c1796

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Rebuild on current main. Restore the set-membership sidebar account-block matcher
(#6647, which fixed the same order-sensitive regex, was reverted on main, so the
guard is failing on main again) and keep the watchdog replacement-race fix, whose
blocked-watchdog stub now waits without a timeout so a superseded watchdog stays
alive until cleanup regardless of scheduler load.
@danielhanchen
danielhanchen force-pushed the agent/stabilize-studio-regression-tests branch from baff5c1 to 685f843 Compare July 17, 2026 23:54
@danielhanchen

Copy link
Copy Markdown
Member

Update on the earlier sync. #6647 was reverted on main shortly after it landed, which restored the old order-sensitive sidebar regex and moved model-selector.tsx back to components/assistant-ui. That left the sidebar account-block guard failing on main again (the same bug this PR targets), and it showed up as the Repo tests (CPU) failure here.

I rebuilt this branch on current main with the two original fixes: the set-membership account-block matcher (order-independent, so it survives utility reordering) and the watchdog replacement-race fix. Both test files pass against current main (33 tests). Net diff versus main is just the two test files. The model-selector path is back at components/assistant-ui to match current main.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 685f843696

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ec27dea236

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shimmyshimmer
shimmyshimmer marked this pull request as ready for review July 18, 2026 12:47
@danielhanchen
danielhanchen merged commit 9db639f into main Jul 18, 2026
39 checks passed
@danielhanchen
danielhanchen deleted the agent/stabilize-studio-regression-tests branch July 18, 2026 12:54
VectorCipher pushed a commit to VectorCipher/unsloth that referenced this pull request Jul 20, 2026
* Stabilize Studio regression tests

Rebuild on current main. Restore the set-membership sidebar account-block matcher
(unslothai#6647, which fixed the same order-sensitive regex, was reverted on main, so the
guard is failing on main again) and keep the watchdog replacement-race fix, whose
blocked-watchdog stub now waits without a timeout so a superseded watchdog stays
alive until cleanup regardless of scheduler load.

* Tighten the blocked-watchdog stub comment

---------

Co-authored-by: Daniel Han <[email protected]>
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.

2 participants