Skip to content

tests: rendered launch argv under production defaults - #900

Merged
michaellchung merged 2 commits into
mainfrom
test/prod-defaults-argv
Nov 26, 2026
Merged

michaellchung merged 2 commits into
mainfrom
test/prod-defaults-argv

Conversation

@michaellchung

Copy link
Copy Markdown
Contributor

Why

tests/conftest.py changes production defaults for every test. With them, an argv that yeto renders for another process passes the suite even when that process refuses it. The image smoke (#894) hit this: its trainer argv lacked --inner-lr and --preflight-model off, the tests were green, and a real run refused it.

Global changes in tests/conftest.py (audit)

The repository has one conftest.py.

Change What it does Why (blame / comment) What it can hide
yeto.cli.DEFAULT_INNER_LR = 3e-4 (module level, #346) The --inner-lr default is a plain float, so refuse_unset_inner_lr never fires Most launch tests build RL argv without --inner-lr A rendered RL launch argv without --inner-lr (run up, fleet island, image smoke)
_no_real_model_preflight: YETO_PREFLIGHT_MODEL=off (autouse, #348) Skips the trainer model preflight No Hub / Modal / bucket access in unit tests A rendered argv that needs --preflight-model off, and a model that does not exist
_no_real_image_manifest_check: YETO_IMAGE_MANIFEST_CHECK=off (autouse, #833) Skips the registry HEAD of trainer images No registry access An image ref that the real check refuses
_no_sky_server_version_check: YETO_SKY_SERVER_CHECK=off (autouse, #744) Skips the sky API server version check No dependency on a local sky server Low risk: depends on the host, not the argv
YETO_RL_COMPAT_GROUP=nvidia-h100 (module level, setdefault, decoupling 7.7a) Every process has a compat group Identities built at import time An island env that lacks the compat group (the island entry fails on the node)
YETO_SYNCER_ALLOW_UNAUTHENTICATED=1 (module level) Syncer starts without an HMAC key Unit tests spawn syncers on loopback A launch that ships no island key
_island_hmac_key_does_not_leak (autouse) Resets YETO_ISLAND_HMAC_KEY around each test Keys generated into os.environ leak between tests Nothing (isolation only)
_no_teardown_diagnostics: YETO_TEARDOWN_DIAG=0 No log pulls before teardown No ssh/sky Teardown diagnostics paths
_no_real_nebius_sg_cleanup cli._nebius_sg_cleanup is a no-op No Nebius API Cleanup wiring (has an opt-out marker)
_no_remote_model_config fragment_preflight.remote_hf_config fetches nothing No Hub / store / Modal The verl layout check with a remote config
_no_ssh_connection_reuse: YETO_SSH_MUX=off No ssh master connections No real ssh ssh transport behaviour
_no_real_ssh_config node_pool.SSH_CONFIG goes to tmp Never edit the user's ssh config Nothing argv-related
_fixed_thread_reading Thread preflight reads a fixed count No dependency on host threads Thread preflight thresholds
_no_release_download_spread DOWNLOAD_SPREAD_S = 0 Fast tests Download timing
_block_unmarked_ray_init, _reap_syncer_groups, _StoreEnvGuard, home guard, shard selection, syncer toolchain env Isolation and hygiene Safety Nothing argv-related

The first five can hide a missing flag in a rendered argv. They stay global: with the --inner-lr override removed, 70 of 100 tests in tests/test_rl_launcher.py alone fail. So this PR adds an opt-in fixture and a RISK note at each override instead.

What this adds

  • tests/prod_defaults.py: apply(monkeypatch) undoes the five overrides for one test. It restores the marked --inner-lr default and deletes the four variables. The probes those checks call are stubbed, so nothing touches the network: Hub listing and moving-revision resolve, Modal volume listing, store and bucket LIST, registry manifest HEAD, and sky server version. The stubs report "present" and record what they were asked, so a test can assert that the check actually ran. launch_dry_run(argv) runs yeto.cli main(["launch", *argv, "--dry-run"]).
  • production_defaults fixture in conftest, plus RISK comments that point to the new tests.
  • tests/test_prod_defaults_argv.py (18 tests). Each one undoes the conftest changes, renders the argv the way the product does, and hands it to the real parser of the process that receives it:
    • run up --dry-run of the four own-cluster templates. These cover a trainer on own nodes with sky or Modal samplers, an own sampler pool, and a fleet of an own island and a cloud island. Each run up executes its yeto launch --dry-run and nc pool --dry-run calls in-process.
    • run up --dry-run of the K3.1 bare-metal config. The production defaults are restored after that harness sets YETO_PREFLIGHT_MODEL=off.
    • The K3.1 customer trainer argv (agentic 262k, bare-metal B300 262k, customer kit) through yeto launch --dry-run, with the model preflight in check mode.
    • The Modal island config of the customer agentic run: its run script's island_entry command is parsed by the island's parser with only the island config's env, and the compat group is resolved from that env alone.
    • The ssh: island of the bare-metal run and of the kit: node_env / start_script, then the island entry is parsed with only the node env.
    • The NC pool --dry-run of the customer pool, then the node spec it renders, read back the way engine_sampler reads it.
    • A fleet's compiled trainer.argv (two fleet examples), each per-island launch (island_launches.launch_argv, which trainer_worker runs as python -m yeto.cli launch), and each island's entry command.
    • A sky (AWS) trainer island's task run script, parsed with only the task env.
    • Negative tests: a run config without --inner-lr, and a launch whose model the Hub does not have. Both pass under the conftest defaults and are refused under production defaults.

Findings

  • No missing-flag bug on any path on main. No product code changed.
  • Mutation check: three hand-made mutations each make the new tests fail.
    • The island launch drops --inner-lr: 2 new tests fail. The existing tests/test_fleet_island_launches.py (11 tests) stays green, which is exactly the blind spot.
    • The island task drops --inner-lr: 5 new tests fail.
    • The island task drops YETO_RL_COMPAT_GROUP from its env: 5 new tests fail.
  • Not covered: the image smoke trainer plan (image adopt, image adopt: manifest digest, image probe, fit to the nodes and parallel pre-pull #893/image adopt: trainer and sampler smoke, the yeto image adopt command and its docs #894) is not on main. Its argv can use prod_defaults.launch_dry_run once it lands.
  • yeto shape --apply with an RL island shape renders launch ... --training-mode rl with no RL recipe flags. That argv is refused for reasons that have nothing to do with these overrides (sync preset, reward function), so the overrides are not what hides it. It is left as is.

Tests

  • New tests: 18 passed. tests/test_rl_inner_lr_guard.py also passes.
  • Full suite in 4 shards: 4548 / 4527 / 4505 / 4535 passed.
    • One failure: tests/test_rl_cut_distopt_pp_ep.py::test_host_background_writes_the_inline_shard_from_one_host_copy (KeyError: 'coord' in cut_plugin.py).
    • This test is intermittent on the same main commit without this change: it failed 4 of 5 local runs on main and 1 of 5 on this branch. It is unrelated to this change.
  • Customer gate:
    • 52 customer goldens (tests/test_k31_customer_plan_golden.py and tests/golden/breakers): 52 passed.
    • examples/k31 dry-runs (run up of run.agentic-262k and run.baremetal-b300-262k with their preflight logs, and the NC pool pool.nc-mi355x-agentic-262k), normalized: identical line by line to main d9fb379.
    • No file changed under tests/golden, tests/fixtures/k31_customer_kit or examples/k31.

🤖 Generated with Claude Code

michaellchung and others added 2 commits November 27, 2026 00:00
tests/conftest.py relaxes production defaults for every test (the
--inner-lr default reads as explicit; YETO_PREFLIGHT_MODEL,
YETO_IMAGE_MANIFEST_CHECK and YETO_SKY_SERVER_CHECK are off;
YETO_RL_COMPAT_GROUP is set), so an argv yeto renders for another
process passes the suite even when that process refuses it.

tests/prod_defaults.py puts the production defaults back for one test,
with stub Hub, Modal volume, store, registry and sky server probes that
answer "present", and runs a rendered argv through the real yeto.cli
launch --dry-run. tests/test_prod_defaults_argv.py uses it on every
render-and-hand-off path on main: run up of the own-cluster templates
and the K3.1 bare-metal config, the K3.1 customer trainer launches, the
Modal and ssh: island entry commands parsed with only the island's own
environment, the NC pool dry run and the node spec it renders, a
fleet's compiled trainer argv, each per-island launch, and a sky
island's entry. Two negative tests show the check bites: a run config
without --inner-lr and a launch whose model the Hub lacks pass under
the conftest defaults and are refused under production's.

conftest: opt-in production_defaults fixture, and a RISK note at each
global override pointing at the new tests. The overrides stay global:
about 70 % of tests/test_rl_launcher.py builds RL argv without
--inner-lr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pool dry run checks with shutil.which that nc-manage and nc-query
are on this host; the test took them from the developer's PATH, so it
passed locally and failed on the CI runner, which has neither. The test
now points NC_MANAGE / NC_QUERY at executable stubs in its tmp dir
(recording any call, which the dry run must not make) and clears
NC_TOOL_DIR / NC_NODE_BIN. The refusal summary also lists the pool's
"problem:" lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaellchung
michaellchung force-pushed the test/prod-defaults-argv branch from d3f1764 to 999257a Compare November 26, 2026 16:01
@michaellchung
michaellchung merged commit befed09 into main Nov 26, 2026
7 checks passed
@michaellchung
michaellchung deleted the test/prod-defaults-argv branch November 26, 2026 16:53
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