Repository navigation
Fix Windows test fixture issues and improve path handling - #6
Conversation
Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: <>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Signed-off-by: <>
Resolve local image paths and convert them with Path.as_uri so Windows drive letters and URI-special filename characters survive media loading. Preserve existing URLs and cover absolute and relative local paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Signed-off-by: <>
Set VLLM_BATCH_INVARIANT through the environment rather than monkeypatching its lazy module attribute. Attribute teardown otherwise materializes False and masks subsequent tests' environment overrides. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Signed-off-by: <>
Torch 2.16.0.dev20261009 still lacks upstream PR 196013. Remove the premature 2.16 cutoff so mutable custom ops with E8M0 inputs are decomposed for both auto-functionalization versions. Keep the backport until the minimum supported Torch actually includes the upstream fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Signed-off-by: <>
Windows PyTorch does not expose HashStore. Use a single-participant FileStore under pytest's temporary directory while preserving the configured Gloo timeout assertion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Signed-off-by: <>
Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| fake_melody.render_cmd3 = slow_render | ||
| fake_melody.render_cmd4 = slow_render | ||
| renderer._melody = fake_melody | ||
|
|
There was a problem hiding this comment.
maybe gate mock by platform?
There was a problem hiding this comment.
I'd keep this mock platform-independent. This test already replaced Melody with blocking render_cmd3/render_cmd4 mocks on every platform: it tests thread-pool offloading and event-loop responsiveness, not Melody integration.
The change injects that same mock during construction instead of afterward, so the optional cohere_melody import cannot fail before the test runs. Gating it to Windows would retain an unnecessary dependency on Linux without adding real Melody coverage. Production imports and rendering are unchanged.
There was a problem hiding this comment.
Is this test relying on side effects of _try_import_melody before renderer._melody = fake_melody in linux?
There was a problem hiding this comment.
I traced the constructor and async call path and found no required Melody-import side effect for this test:
BaseRenderer.__init__creates the Python thread-pool executor before_try_import_melody()runs._try_import_melody()only imports and returns the package. The constructor stores that result inself._melody; it does not call any Melody initialization function._render_asyncwrapsself._renderusingmake_async, which callsloop.run_in_executor._renderreadsself._melodywhen invoked, so both the old and new test execute the same Pythonslow_rendermock, not a Melody binding.
The fixture also disables multimodal processing and uses a mocked tokenizer. Moving the injection earlier leaves the real executor and renderer async path intact; the old import was not needed to set those up. I'm not claiming that importing the third-party package has no side effects in general, or that I ran this on Linux—only that this unit-test path does not consume any such initialization.
There was a problem hiding this comment.
keep it unchanged in linux, and fix in windows with gate, to make the intent clear.
Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This reverts commit 3d8213b. Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Squash the net changes from #6. * Fix UTF-8 decoding of DeepSeek test fixtures on Windows. Read the DeepSeek V4 and V4.1 JSON and golden-text fixtures explicitly as UTF-8, independent of the platform's default text encoding. * Fix platform-native path expectations in Windows tests. Compare resolved paths and repository-relative paths using the native pathlib string representation. * Fix Windows file URIs for benchmark image paths. Resolve local paths and use Path.as_uri so drive letters and URI-special filename characters are preserved. Keep existing URLs unchanged and cover absolute and relative paths and encoded image media. * Fix batch-invariant flag leaking from grouped topk test. Set VLLM_BATCH_INVARIANT through the environment instead of materializing its lazy module attribute during monkeypatch teardown. * Keep the Inductor E8M0 pattern matcher backport enabled on Torch nightlies. Remove the premature version cutoff for mutable custom-op decomposition across both auto-functionalization versions. Track the upstream fix at pytorch/pytorch#196013 and remove the backport once the minimum supported Torch includes it. * Use a portable FileStore in the distributed timeout test. Replace HashStore with a single-participant FileStore in pytest's temporary directory, retaining the configured Gloo timeout assertion. The temporary Melody import mock and its revert cancel in the aggregate; no Cohere renderer changes are included. Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Squash the net changes from #6. * Fix UTF-8 decoding of DeepSeek test fixtures on Windows. Read the DeepSeek V4 and V4.1 JSON and golden-text fixtures explicitly as UTF-8, independent of the platform's default text encoding. * Fix platform-native path expectations in Windows tests. Compare resolved paths and repository-relative paths using the native pathlib string representation. * Fix Windows file URIs for benchmark image paths. Resolve local paths and use Path.as_uri so drive letters and URI-special filename characters are preserved. Keep existing URLs unchanged and cover absolute and relative paths and encoded image media. * Fix batch-invariant flag leaking from grouped topk test. Set VLLM_BATCH_INVARIANT through the environment instead of materializing its lazy module attribute during monkeypatch teardown. * Keep the Inductor E8M0 pattern matcher backport enabled on Torch nightlies. Remove the premature version cutoff for mutable custom-op decomposition across both auto-functionalization versions. Track the upstream fix at pytorch/pytorch#196013 and remove the backport once the minimum supported Torch includes it. * Use a portable FileStore in the distributed timeout test. Replace HashStore with a single-participant FileStore in pytest's temporary directory, retaining the configured Gloo timeout assertion. The temporary Melody import mock and its revert cancel in the aggregate; no Cohere renderer changes are included. Signed-off-by: Chao Zhang <zhangchao@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No description provided.