Skip to content

[flink-cdc] Stabilize MySqlSyncDatabaseActionITCase.testSyncMultipleShards#8736

Merged
JingsongLi merged 1 commit into
apache:masterfrom
wombatu-kun:flink-cdc/stabilize-sync-multiple-shards-it
Jul 20, 2026
Merged

[flink-cdc] Stabilize MySqlSyncDatabaseActionITCase.testSyncMultipleShards#8736
JingsongLi merged 1 commit into
apache:masterfrom
wombatu-kun:flink-cdc/stabilize-sync-multiple-shards-it

Conversation

@wombatu-kun

Copy link
Copy Markdown
Contributor

Purpose

MySqlSyncDatabaseActionITCase.testSyncMultipleShards intermittently fails CI with java.util.concurrent.TimeoutException: testSyncMultipleShards() timed out after 120 seconds (for example, it failed the CI run of an unrelated PR #8735, whose changes are confined to paimon-common global btree index code and cannot reach Flink CDC). This is a flaky timeout, not a functional regression.

Two things make the test prone to spurious timeouts.

First, the 120s per-method budget is tight for this test. Unlike its siblings it does several sequential waitForResult phases, each preceded by a schema ALTER that forces the CDC source to re-snapshot the changed table, on top of Flink job startup and the initial MySQL snapshot/binlog switchover. Under a loaded CI runner this legitimately exceeds 120s even though the data volume is tiny. This raises the timeout to 240s, the same value already used by the comparable heavy multi-table test in this class, testSyncManyTableWithLimitedMemory (the newly-added-table tests use 600s).

Second, the test called the JobClient-less waitForResult overload, in which checkJobNotTerminated(...) is a no-op. If the CDC job ever dies, the test cannot tell a dead job from a slow one and simply hangs until the outer @Timeout fires, producing an opaque timeout with no diagnosis. This captures the JobClient returned by runActionWithDefaultEnv(...) and threads it through the four waitForResult calls, so a terminated job now fails fast with a clear AssertionError instead of hanging. This matches the pattern already used by other tests in the same file (for example the newly-added-table tests).

No production code changes; test-only.

Tests

MySqlSyncDatabaseActionITCase.testSyncMultipleShards (the modified test itself).

…hards

testSyncMultipleShards intermittently fails CI with java.util.concurrent.TimeoutException: testSyncMultipleShards() timed out after 120 seconds (for example, it failed the CI run of an unrelated PR apache#8735, whose changes are confined to paimon-common global btree index code and cannot reach Flink CDC). This is a flaky timeout, not a functional regression.

Raise the per-method @timeout from 120s to 240s. Unlike its siblings this test does several sequential waitForResult phases, each preceded by a schema ALTER that forces the CDC source to re-snapshot the changed table, on top of Flink job startup and the initial MySQL snapshot/binlog switchover, so under a loaded CI runner it legitimately exceeds 120s even though the data volume is tiny. 240s is the value already used by the comparable heavy multi-table test in this class, testSyncManyTableWithLimitedMemory (the newly-added-table tests use 600s).

Capture the JobClient returned by runActionWithDefaultEnv and thread it through the four waitForResult calls. Previously the test used the JobClient-less overload, in which checkJobNotTerminated is a no-op, so a dead CDC job was indistinguishable from a slow one and the test simply hung until the outer @timeout fired, yielding an opaque timeout with no diagnosis. With the client wired in, a terminated job now fails fast with a clear AssertionError. This matches the pattern already used by other tests in the same file.

No production code changes; test-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 6596efd into apache:master Jul 20, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants