TEST Fix flaky XPIA unit tests by stubbing workflow._memory#1716
Merged
hannahwestra25 merged 1 commit intoMay 11, 2026
Conversation
1e9d757 to
7887068
Compare
romanlutz
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Four tests in test_xpia.py were failing in CI with
RuntimeError: memory offline:test_perform_async_complete_workflow_with_scorertest_perform_async_workflow_without_scorertest_perform_async_scorer_returns_empty_listtest_perform_async_scorer_raises_exceptionRoot cause
These tests exercise
XPIAWorkflow._perform_async, which calls_execute_processing_async, which in turn writes the processing response to memory viaself._memory.add_message_to_memory(...). Unliketest_execute_processing_async_adds_to_memory, the failing tests did not replaceworkflow._memorywith a mock, so they depended on a live central memory backend that isn't reliably available in CI.Fix
Update the shared
workflowpytest fixture (and the inline workflow construction intest_perform_async_workflow_without_scorer) to stubworkflow._memorywith aMagicMock. This keeps the tests properly unit-scoped and isolates them from the real memory backend without changing production behavior.Tests and Documentation
Ran updated tests