Skip to content

Fix invalid StorageTestCase scenarios involving trial state and values#6391

Merged
y0z merged 2 commits intooptuna:masterfrom
c-bata:follow-up-storage-test-case
Dec 25, 2025
Merged

Fix invalid StorageTestCase scenarios involving trial state and values#6391
y0z merged 2 commits intooptuna:masterfrom
c-bata:follow-up-storage-test-case

Conversation

@c-bata
Copy link
Copy Markdown
Member

@c-bata c-bata commented Dec 18, 2025

Motivation

Follow-up #6369

Description of the changes

StorageTestCase includes several scenarios that do not align with Optuna’s expected trial lifecycle. These patterns are not valid in normal usage and can cause inconsistencies with the current validation logic.

This PR removes or updates the following cases:

  • Marking a trial as COMPLETE without providing values.
  • Providing values when marking a trial as FAIL, which violates the constraints enforced by FrozenTrial._validate().
  • Providing values for a WAITING trial, which is obviously unexpected scenario.

@c-bata c-bata added the code-fix Change that does not change the behavior, such as code refactoring. label Dec 18, 2025
@c-bata
Copy link
Copy Markdown
Member Author

c-bata commented Dec 18, 2025

@y0z @kAIto47802 Could you review this PR?

Copy link
Copy Markdown
Collaborator

@kAIto47802 kAIto47802 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. I left some comments. PTAL :octocat:

Co-authored-by: kAIto47802 <115693559+kAIto47802@users.noreply.github.com>
@c-bata
Copy link
Copy Markdown
Member Author

c-bata commented Dec 24, 2025

@kAIto47802 Thank you for your review. I applied your suggestions. PTAL.

Copy link
Copy Markdown
Collaborator

@kAIto47802 kAIto47802 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update! LGTM

@kAIto47802 kAIto47802 removed their assignment Dec 24, 2025
Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0z y0z added this to the v4.7.0 milestone Dec 25, 2025
@y0z y0z merged commit b542b9d into optuna:master Dec 25, 2025
13 checks passed
@c-bata c-bata deleted the follow-up-storage-test-case branch December 26, 2025 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-fix Change that does not change the behavior, such as code refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants