Fix failing tests in fireworks/core/tests/test_launchpad.py + ruff fixes
#558
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix CI errors after merging #555 (which had green CI). looks like that there are some flaky tests in
test_launchpad.pythat this PR aims to improve. breakdown of changes:test_launchpad.pyfixes1. Fixed MongoDB Command API Compatibility (Lines 60, 63)
Issue:
TypeError: Database.command() takes 2 positional arguments but 3 were givenRoot Cause: pymongo 4.x changed the
Database.command()API from accepting multiple positional arguments to requiring a single dictionary argument.Fix: Updated command calls to use dictionary format:
2. Fixed WFLockTest Race Condition (Lines 1147-1154)
Issue:
test_fix_db_inconsistencies_completedfailed intermittently when fw_id=2 timed out waiting for workflow lock.Root Cause: The 1-second sleep wasn't sufficient to guarantee fw_id=1 acquired the workflow lock before fw_id=2 started.
Fix: Added active polling to wait for fw_id=1 to reach RUNNING state before launching fw_id=2:
3. Fixed WorkflowFireworkStatesTest Cache Inconsistency (Lines 967-970, 1001-1004)
Issue:
test_rerun_timed_fwsfailed withAssertionError: assert 'RESERVED' == 'READY'Root Cause: When processes are terminated, fireworks can be left in RESERVED state while workflow cache shows READY. The cache is not automatically updated when reservations occur.
Fix: Before each state sync assertion, unreserve any RESERVED fireworks and refresh workflows: