fix: batched upload permanently truncates in-memory test run#2597
Open
aerosta wants to merge 1 commit intoconfident-ai:mainfrom
Open
fix: batched upload permanently truncates in-memory test run#2597aerosta wants to merge 1 commit intoconfident-ai:mainfrom
aerosta wants to merge 1 commit intoconfident-ai:mainfrom
Conversation
|
@aerosta is attempting to deploy a commit to the Confident AI Team on Vercel. A member of the Team first needs to authorize it. |
53d9a72 to
5bb5168
Compare
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.
Summary
Large test runs are uploaded in batches, but
post_test_run()mutates the caller's in-memoryTestRunwhile doing so. It replacestest_run.test_casesortest_run.conversational_test_caseswith only the first batch and clearstest_run.prompts, but never restores that state afterward.This means any code that reads the same
TestRunobject after upload can see a partial run instead of the full evaluated result.This change snapshots the original state before batching and restores it in a
finallyblock, so the full in-memory run is preserved whether upload succeeds or fails.Changes
deepeval/test_run/test_run.py: preserve and restore the original run state during batched uploadtests/test_core/test_run/test_run_manager.py: add regression coverage for successful batched upload and mid-upload failureTest plan