Skip to content

Fix wait_for_condition to return ser/des round-tripped result on first run #544

Description

@ayushiahjolia

Problem:
wait_for_condition returns inconsistent results between the first run and replay when a custom SerDes is configured. On the first run, execute() returns the raw new_state produced by the check function. On replay, the value is reconstructed via deserialize(serialize(new_state)) from the checkpoint. If the SerDes is not a perfect round-trip (e.g. it normalizes, drops, or transforms fields), callers observe one value on the first execution and a different value after any replay.

Fix:
On the success path in operation/wait_for_condition.py, return the round-tripped value (deserialize of the serialized state) instead of the raw new_state, so the first run yields the same result the replay path would produce. Preserve None handling to match the replay behavior. Add a test using a non-identity SerDes
that asserts the first-run result equals the replayed result.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

Status
In review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions