Skip to content

Tests: fix three checks that fail for reasons other than a regression - #13265

Merged
danielhanchen merged 1 commit into
mainfrom
test-drift-fixes-1011
Oct 11, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
test-drift-fixes-1011

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Three checks on main fail for reasons that are not a regression. Each one was reproduced on main, and the cause traced to the change that broke it.

Changes

tests/utils/test_varlen_int32_overflow_guard.py

.github/scripts/compare_installer_evidence.py

  • A dispatch of the Windows installer differential on main reported one change in the uv download that was not real.
  • The base side's transcript has the same finished winget bar twice in a row (██████ <size> / <size>). The head side, downloading the same uv 0.13.0 zip, has it once.
  • This is the same timing noise as the partial frames handled in Installer differential: ignore winget's partly filled download bars #13172. The comparer now drops a full bar only when it repeats the line kept right before it.
  • Two new tests pin what still compares:
    • a repeated full bar does not fail;
    • a second download, which has its own Downloading line between the bars, still fails when one of its bars is lost.
  • Replaying that run's evidence with this change leaves only the intended diffusers message from Studio: install the released Diffusers 0.41.0 instead of the pinned main commit #13045, which a PR run (base = merge base) does not see.

studio/backend/tests/test_studio_api.py

  • test_help_output fails with Missing flag '--max-seq-length'.
  • The flag is still there. When stdout is not a terminal, Rich lays the help out at 80 columns and cuts the --max-seq-length, --context-length cell to --max-seq-lengt….
  • The test now sets COLUMNS=200 for that one subprocess. This file is a live-server script that no CI job runs.

Testing

Check main this branch
test_varlen_int32_overflow_guard.py 2 failed, 22 passed 24 passed
test_installer_differential_comparer.py 90 passed 92 passed
compare_installer_evidence.py --self-test pass pass
Staging evidence replay (e12c24fb33 vs 62ea2d7b52) 2 differences: bar + diffusers 2 differences: diffusers only
test_studio_api.py::test_help_output failed passed

No product code changes.

- test_varlen_int32_overflow_guard: since #12740 SDPA attends packed rows one
  segment length at a time, so the guarded fallback is two SDPA calls (the
  one-token documents and the padded tail). Assert that only SDPA ran.
- compare_installer_evidence: drop a full winget download bar that repeats
  the line right before it. A staging run of the same uv download left it
  once on one side and twice on the other.
- test_studio_api test_help_output: render help at 200 columns. At Rich's
  80-column default the option cell is cut to --max-seq-lengt...
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T04:09:28.320093Z 853d5eb Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-11T04:07:10.333343Z 853d5eb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 853d5eb687

ℹ️ 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
danielhanchen merged commit f0db334 into main Oct 11, 2026
@danielhanchen
danielhanchen deleted the test-drift-fixes-1011 branch October 11, 2026 04:32
danielhanchen added a commit that referenced this pull request Oct 18, 2026
…solver checks hold on every host (#14116)

Follow-up to #13265, #13395 and #13701. Each one was rechecked on other
hosts and environments, and these four gaps showed up. Each one
reproduces on `main` and is fixed here. No product code changes.

## Studio `--help` test (#13265)

`COLUMNS=200` is not enough. Typer passes an inherited `TERMINAL_WIDTH`
to Rich as an explicit width. `GITHUB_ACTIONS`, `FORCE_COLOR` or
`PY_COLORS` force terminal mode, whose colour codes split every flag
(`--model` no longer appears as a substring). On staging, the test fails
on `ubuntu-latest` and `macos-15` for exactly this reason. The test now
also sets `TERMINAL_WIDTH=200` and `_TYPER_FORCE_DISABLE_TERMINAL=1`
(both present from Typer 0.19, the floor), and it decodes the child's
output as UTF-8 so a CJK Windows code page cannot break the decode.

| Environment | `main` | Here |
| --- | --- | --- |
| none | pass | pass |
| `TERMINAL_WIDTH=80` | fail | pass |
| `GITHUB_ACTIONS=true` | fail | pass |
| `FORCE_COLOR=1` | fail | pass |
| `PY_COLORS=1` | fail | pass |
| `GITHUB_ACTIONS=true TERM=dumb` | fail | pass |

## Media scan tests (#13395)

`test_media_model_index_accounts.py` and `test_openai_catalog.py`
cleared `HF_HOME` and redirected `XDG_CACHE_HOME`. The scan also reads:
- `hf_default_cache_dir()`, which is `Path.home() / ".cache" /
"huggingface" / "hub"` and ignores `XDG_CACHE_HOME`;
- the LM Studio, Hermes, Ollama and oMLX model folders, including the
system-wide Ollama paths;
- `./models` under the working directory.

So the most common developer setup, an image model in the default HF
cache, still added rows. Both fixtures now point those helpers at the
test's temp dir and run from it. Patching the helpers rather than `HOME`
means the fix works the same on Windows (`USERPROFILE`), macOS and
Linux.

Result with a fake image model planted in each location (33 tests in
each case):

| Case | `main` | Here |
| --- | --- | --- |
| clean | 33 passed | 33 passed |
| model in `~/.cache/huggingface/hub`, `~/.lmstudio/models`,
`OLLAMA_MODELS` | 4 failed | 33 passed |
| pytest run from a folder with `models/<x>/model_index.json` | 4 failed
| 33 passed |

## Installer differential comparer (#13265)

The rule that drops a repeated 100% bar (a winget redraw) compared lines
after sizes were normalised. That made two genuinely different events
collapse into one bar and compare equal:
- a second transfer with no header line, where a partial frame sits
between the two full bars;
- two finished downloads of different sizes.

A repeat is now dropped only when no partial frame was seen since the
kept bar and the raw numbers match. Two new tests cover these cases;
they fail on `main` and pass here. The existing redraw test still passes
(94 passed).

## Node harness resolver (#13701)

#13701 lets a `const` bound to an arrow or function expression be lifted
even when some of its references cannot be. Two shapes could now
load-crash a harness:
- an eagerly evaluated const that calls such a helper on load (`const
TABLE = { v: f() }`, directly or through another helper);
- an immediately invoked `const v = function () { ... }();`, which runs
on load.

The first is now dropped like a const that reads the missing reference
itself. A const that only names the helper (`[g]`) is kept. The second
stays eager.

No current frontend source has either shape: a sweep of every top-level
declaration in `studio/frontend/src` found no harness that loads only on
one side. All 278 tests that use the resolver pass, and the two new
tests fail with the old resolver.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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