Skip to content

test(frontend): request self-host metadata from the mocker's endpoint - #18550

Open
zhongdaor-nv wants to merge 1 commit into
mainfrom
zhongdaor/fix-self-host-metadata-test-endpoint
Open

zhongdaor-nv wants to merge 1 commit into
mainfrom
zhongdaor/fix-self-host-metadata-test-endpoint

Conversation

@zhongdaor-nv

@zhongdaor-nv zhongdaor-nv commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Overview

test_worker_serves_metadata_via_http always fails with 404: it requests the self-host metadata route under component sample, while the mocker it starts registers under backend. This PR requests the component the worker registers under, so the test checks the route again.

Key Changes

Core logic: 0 lines. One test file (+5/−5).

The three assertions (config.json is 200 and parses as a HF config, missing.json is 404, vocab.json is 200 and non-empty) are unchanged.

Validation

Cause. MockerWorkerProcess passes no --endpoint, so the mocker uses DEFAULT_ENDPOINT = dyn://dynamo.backend.generate (components/src/dynamo/mocker/args.py). sample is the default component of SampleUnifiedWorkerProcess, a different class. The route is an exact lookup on the endpoint triple, so the worker correctly answers 404 Not found. The URL has been wrong since #10351 added the endpoint triple to it.

Fix. The test requests /v1/metadata/dynamo/backend/generate/..., the endpoint the worker registered.

Assumption kept. The dynamo segment is the default namespace. The mocker builds its default endpoint from DYN_NAMESPACE (default dynamo) and DYN_NAMESPACE_WORKER_SUFFIX (components/src/dynamo/mocker/args.py, components/src/dynamo/common/utils/namespace.py), so the URL matches only when neither variable is set in the test environment. The test made the same assumption before this change, and this PR leaves it as is.

Case Before (main @ 0f6b82b) After
test_worker_serves_metadata_via_http AssertionError: GET http://localhost:24170/v1/metadata/dynamo/sample/generate/qwen_qwen3-0_6b/_base/config.json returned 404: Not found (1 failed in 4.06s) 1 passed in 4.18s

The worker log of the failing run shows Using default endpoint: dyn://dynamo.backend.generate. Run on x86_64 against the ai-dynamo / ai-dynamo-runtime 1.7.0.dev20261110 wheels with the mocker, etcd 3.4.30, and nats-server 2.10.24.

CI coverage. No workflow selects this test: it is post_merge + gpu_0 with no backend marker, and the non-backend jobs select pre_merge only (see the TODO: widen to include post_merge in post-merge-ci.yml). CI on this PR does not exercise the change, so the run above is the validation. To reproduce:

python -m pytest -m "post_merge and gpu_0" tests/frontend/test_self_host_metadata.py

Issues and Ongoing Work

Pull Request Checklist
  • I used Dynamo's /pr-checklist skill.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated a metadata HTTP test to use the backend component route.

`test_worker_serves_metadata_via_http` requested
`/v1/metadata/dynamo/sample/generate/...`, but `MockerWorkerProcess`
passes no `--endpoint`, so the mocker registers its metadata under its
default `dyn://dynamo.backend.generate`. `sample` is the default component
of `SampleUnifiedWorkerProcess`, a different class. The route is an exact
lookup on the endpoint triple, so the worker correctly answered 404 and the
first assertion failed.

Request the component the worker registers under. The three assertions
(config.json is 200 and parses as a HF config, missing.json is 404,
vocab.json is 200 and non-empty) are unchanged.

Signed-off-by: Zhongdao Ren <zhongdaor@nvidia.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added the test label Nov 11, 2026
@zhongdaor-nv
zhongdaor-nv marked this pull request as ready for review November 11, 2026 01:30
@zhongdaor-nv
zhongdaor-nv requested a review from a team as a code owner November 11, 2026 01:30
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The metadata HTTP test now uses backend in its route and documents the mocker’s default endpoint as dyn://dynamo.backend.generate.

Changes

Metadata HTTP test

Layer / File(s) Summary
Align test route with mocker endpoint
tests/frontend/test_self_host_metadata.py
The test documents the mocker’s default endpoint and uses component backend in the metadata URL instead of sample.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Severity of issue fixed: Low

Merge Risk: Minimal · up to c5a47

The test route is corrected without changing product behavior. No merge-blocking risk is identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies the main change: the test now requests self-host metadata from the mocker’s endpoint.
Description check Passed The description includes all template sections and explains the issue, code change, validation, CI coverage, and ongoing work. It also completes the checklist and links the issue.
Linked Issues check Passed Issue #18547 requires the test to request the metadata route under the mocker’s registered endpoint and check the expected 200, 404, and 200 responses. The diff changes the component from sample to …
Out of Scope Changes check Passed The diff changes only the URL and its explanatory comment in tests/frontend/test_self_host_metadata.py. Both changes directly address issue #18547. No unrelated changes appear in the reviewed diff.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #18547 requires the test to request the metadata route under the mocker’s registered endpoint and check the expected 200, 404, and 200 responses. The diff changes the component from sample to backend and updates the comment to identify dyn://dynamo.backend.generate. The PR description reports that the existing three assertions remain unchanged and that the targeted test passes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0f6b82b and c5a4724.

Files selected for processing: 1

  • tests/frontend/test_self_host_metadata.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

✅ Dynamo PR CI passed — run 42936178546 (attempt 2) on c5a47249af

Gate checks: ✅ backend-status-check · ✅ deploy-status-check · ✅ dynamo-status-check

Posted automatically by Devin for run 42936178546. Updated on every full-CI run of this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: test_worker_serves_metadata_via_http requests the wrong component and always gets 404

1 participant