Jim Hughes created FLINK-39729:
----------------------------------

             Summary: CorrelateRestoreTest.testRestore[8] 
(CORRELATE_WITH_LITERAL_AGG) is flaky due to non-deterministic changelog 
ordering
                 Key: FLINK-39729
                 URL: https://issues.apache.org/jira/browse/FLINK-39729
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
            Reporter: Jim Hughes
            Assignee: Jim Hughes


`CorrelateRestoreTest.testRestore[8]` (`CORRELATE_WITH_LITERAL_AGG`) is 
intermittently failing because the test asserts exact changelog record 
ordering, but the multi-source streaming plan produces non-deterministic record 
interleaving after restore.

The plan has three independent sources feeding into two streaming joins 
(InnerJoin, LeftOuterJoin, SemiJoin). Post-restore, when `source_t2`'s record 
reaches the SemiJoin before the retract cascade from the 
GroupAggregate+InnerJoin pipeline completes, the `-D[3]` and `+I[3]` changelog 
records are never emitted in the expected window.

The test was introduced in FLINK-37882.

{code}
Expecting actual:
  ["+I[2]", "-D[2]", "+I[2]", "+I[3]"]
to contain exactly in any order:
  ["+I[2]", "+I[3]", "-D[2]", "-D[3]", "+I[2]", "+I[3]"]
but could not find the following elements:
  ["-D[3]", "+I[3]"]
{code}

*Fix:* Switch from changelog assertion to materialized data assertion using the 
existing `testMaterializedData()` + `consumedValues()` pattern (already used by 
`MultiJoinTestPrograms` and `DeltaJoinTestPrograms` for the same class of 
non-determinism). The expected materialized state is `[+I[2], +I[3]]`.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to