Skip to content

Tests: keep tqdm's monitor thread out of the ShareGPT no-threads count - #15992

Merged
danielhanchen merged 1 commit into
mainfrom
tests-sharegpt-no-threads-without-tqdm-monitor
Oct 29, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-sharegpt-no-threads-without-tqdm-monitor

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

studio/backend/tests/test_sharegpt_image_parallel_fetch.py::test_local_only_dataset_starts_no_threads (added in #15786) fails whenever it is the first test in its process to create a tqdm bar, and passes otherwise. Seen on the (Python 3.13, rest) backend shard for #15934, which does not touch this code:

tests/test_sharegpt_image_parallel_fetch.py:173: in test_local_only_dataset_starts_no_threads
E   assert [1] == []

Run on its own it fails every time on main (pytest tests/test_sharegpt_image_parallel_fetch.py::test_local_only_dataset_starts_no_threads). The one thread is tqdm's TMonitor: tqdm.__new__ starts it for the first bar in a process (unless monitor_interval is 0), and the conversion's progress bar is that first bar when nothing earlier in the xdist worker made one. The product does what the test means to check (a local-only dataset takes the serial path and starts no fetch workers); the test counted a process-global helper as a worker.

What changed

The test sets tqdm.std.tqdm.monitor_interval = 0 through monkeypatch before counting, so the process-wide Thread.__init__ count and the active_count() check stay as strict as before and only the monitor is out of the picture.

Verification

  • Base (main): the test alone fails with assert [1] == [].
  • Head: alone 1 passed; whole file 9 passed.
  • With the serial branch in convert_sharegpt_with_images_to_vlm_format forced onto the thread pool (if num_workers <= 1: changed to if False:), the test fails again with assert [1] == [], so it still catches a local-only dataset starting fetch workers.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T15:56:18.111854Z 75601bc 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: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 75601bcf11

ℹ️ 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 81c219b into main Oct 29, 2026
0 of 35 checks passed
@danielhanchen
danielhanchen deleted the tests-sharegpt-no-threads-without-tqdm-monitor branch October 29, 2026 16:02
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