Skip to content

fix(tests): use dynamic patch count assertion in test_verl080_migration - #63

Open
lgc2013 wants to merge 1 commit into
open-sourcefrom
fix/test-patch-count-assertion
Open

fix(tests): use dynamic patch count assertion in test_verl080_migration#63
lgc2013 wants to merge 1 commit into
open-sourcefrom
fix/test-patch-count-assertion

Conversation

@lgc2013

@lgc2013 lgc2013 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

The 3 auto-activation tests in test_verl080_migration.py hardcoded the expected patch count as "PatchHandle (ACTIVE, 7 patches):", but the actual count is environment-dependent:

  • 7 patches when only verl080_fsdp patch set is installed (verl only)
  • 14 patches when both verl080_fsdp + verl080_mcore0161_ms0160 are installed (verl + Megatron Core + MindSpeed)

This caused 3 test failures in environments with the full training stack installed.

Fix

Added _expected_patch_count() helper that dynamically computes the expected patch count by checking whether megatron.core and mindspeed are importable:

  • Both available → 14 (two patch sets match)
  • Otherwise → 7 (only verl080_fsdp)

Updated the 3 test assertions to use this helper instead of a hardcoded number.

Tests

All 30 tests in test_verl080_migration.py now pass (previously 3 failed).

The 3 auto-activation tests hardcoded '7 patches' but the actual count
is environment-dependent: 7 with only verl080_fsdp, or 14 when both
verl080_fsdp and verl080_mcore0161_ms0160 patch sets are installed.

Add _expected_patch_count() helper that checks for megatron.core and
mindspeed availability to compute the correct expected count.
@lgc2013
lgc2013 force-pushed the fix/test-patch-count-assertion branch from 4a8278e to ed26134 Compare August 13, 2026 09:50
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