fix(engine_adapter): preserve pre_ping in with_settings - #5922
Open
Sanjays2402 wants to merge 1 commit into
Open
fix(engine_adapter): preserve pre_ping in with_settings#5922Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
EngineAdapter.with_settings() did not forward the current _pre_ping value to the cloned adapter, and the constructor defaults pre_ping to False. Context.snapshot_evaluator clones the adapter this way, so pre_ping: true silently did not apply to model evaluation or the before_all/after_all environment statements, and a stale connection after a long run failed instead of being re-established. pre_ping is now carried over like the other settings, and remains overridable via an explicit keyword argument. Adds a regression test asserting the cloned adapter keeps pre_ping. Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
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.
Closes #5912.
Description
EngineAdapter.with_settings()did not forward the current_pre_pingvalue to the cloned adapter, and the constructor defaultspre_pingtoFalse.Context.snapshot_evaluatorclones the adapter this way, sopre_ping: truesilently did not apply to model evaluation or thebefore_all/after_allenvironment statements.pre_pingis now carried over like the other settings, and stays overridable via an explicit keyword argument.Test Plan
New
test_with_settings_preserves_pre_pingintests/core/engine_adapter/test_base.py(next to the existingtest_pre_ping); it fails onmainand passes with the fix.tests/core/engine_adapter/test_base.pypasses (122 tests).Checklist
ruff check/ruff formaton the changed filestests/core/engine_adapter/test_base.pypass (122)git commit -s) per the DCO