Skip to content

test: collect the unregistered fast CPU tests and update cpu ci python to 3.12 - #85

Merged
Rockdu merged 3 commits into
radixark:mainfrom
Rockdu:test/collect-fast-cpu-tests
Jul 30, 2026
Merged

test: collect the unregistered fast CPU tests and update cpu ci python to 3.12#85
Rockdu merged 3 commits into
radixark:mainfrom
Rockdu:test/collect-fast-cpu-tests

Conversation

@Rockdu

@Rockdu Rockdu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What

  • Drop the monkeypatch.setattr(backend, "_is_primary", False) line from test_collector_startup_failure_disables_dashboard.
  • Register the three tests/fast files that no CI registration marker covered, so the suite runner collects them.

Why

miles/dashboard/backend.py has never had an _is_primary attribute — it exposes _handle and _resolution_failed, both since the module landed in #58. monkeypatch.setattr defaults to raising=True, so that line raises AttributeError and the test has been failing since the day it was merged. The meaningful part of the setup is the _handle = None patch right above it, so deleting the stale line restores the intended assertion (actor creation raises -> init_dashboard returns False and warns).

It went unnoticed because tests/ci/run_suite.py globs tests/fast/**/test_*.py but collect_tests only keeps files whose source contains a register_*_ci(...) marker (parsed via AST). Three files had none, so CI never ran them:

File Was collected?
tests/fast/dashboard/test_async_collector.py no — and it was red
tests/fast/utils/test_diffusion_rollout_response.py no — green
tests/fast/utils/test_processing_utils.py no — green

Registering them means a future stale patch like this one fails a PR instead of only failing for whoever happens to run pytest tests/fast by hand.

Registering test_async_collector.py also exposed that miles/dashboard/events.py and store.py use enum.StrEnum (3.11+) while stage-a-cpu — the one job that does not run inside the container image — set up Python 3.10 to match setup.py's python_requires=">=3.10". The declaration and the code have disagreed since the dashboard landed. The dev/CI container image is Python 3.12, so the third commit raises the declared floor to 3.12 (setup.py, classifiers, isort py_version, and the two workflow jobs that pin a bare-runner Python) rather than adding a dependency or shimming StrEnum. It is the same commit as in #84, which needs it for the test it adds; whichever lands first makes it a no-op in the other.

Validation

  • collect_tests now returns all three as HWBackend.CPU / stage-a-cpu / est_time=15 / labels=[].
  • pytest tests/fast -q -> 138 passed (was 137 passed + 1 failed).
  • pre-commit run --all-files passes; isort accepts the marker-before-imports layout already used by tests/fast/utils/test_misc.py.

Commits are ordered fix-then-register so the registration never lands while the test is red.

Files

  • tests/fast/dashboard/test_async_collector.py — stale monkeypatch removed, CPU CI registration added.
  • tests/fast/utils/test_diffusion_rollout_response.py — CPU CI registration added.
  • tests/fast/utils/test_processing_utils.py — CPU CI registration added.
  • setup.py, pyproject.toml, .github/workflows/_run-ci.yml, .github/workflows/pre-commit.yml — python floor raised to 3.12.

Checklist

  • pre-commit run --all-files passes
  • Added/updated tests for new behaviour — this PR is the test-side change
  • pytest -x is green — pytest tests/fast is 138 passed
  • If launch flags changed, python3 train.py --help still parses — n/a, no flag changes
  • If a public flag was added, it appears in the CLI reference docs — n/a, no new flag
  • If an example was added, it has a real walkthrough — n/a, no new example

@Rockdu
Rockdu force-pushed the test/collect-fast-cpu-tests branch from f3719af to bd36099 Compare July 30, 2026 19:42
@Rockdu Rockdu changed the title test: collect the unregistered fast CPU tests and fix the red dashboard case test: collect the unregistered fast CPU tests and update cpu ci python to 3.12 Jul 30, 2026
@Rockdu
Rockdu merged commit d4a7b1d into radixark:main Jul 30, 2026
15 checks passed
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