Skip to content

Commit c0c60ca

Browse files
committed
Remove port 20180 check from TiKV wait strategy
- Port 20180 is TiKV's status port but doesn't need to be exposed externally - The log message 'succeed to update max timestamp' is sufficient to indicate readiness - Fixes 'port 20180/tcp not found' error in legacy multi-container approach
1 parent b041826 commit c0c60ca

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

mysql/testcontainers_helper.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,9 @@ func startTiDBCluster(ctx context.Context, t *testing.T, version string) *TiDBTe
434434
},
435435
}
436436
},
437-
WaitingFor: wait.ForAll(
438-
// Wait for TiKV to connect to PD and start serving
439-
wait.ForLog("succeed to update max timestamp").
440-
WithOccurrence(3), // Wait for at least 3 region updates
441-
wait.ForListeningPort("20180/tcp"), // Status port
442-
).WithStartupTimeout(180 * time.Second),
437+
WaitingFor: wait.ForLog("succeed to update max timestamp").
438+
WithOccurrence(3). // Wait for at least 3 region updates - indicates TiKV is ready
439+
WithStartupTimeout(180 * time.Second),
443440
},
444441
Started: true,
445442
})
@@ -762,12 +759,9 @@ func startSharedTiDBClusterLegacy(version string) (*TiDBTestCluster, error) {
762759
},
763760
}
764761
},
765-
WaitingFor: wait.ForAll(
766-
// Wait for TiKV to connect to PD and start serving
767-
wait.ForLog("succeed to update max timestamp").
768-
WithOccurrence(3), // Wait for at least 3 region updates
769-
wait.ForListeningPort("20180/tcp"), // Status port
770-
).WithStartupTimeout(180 * time.Second),
762+
WaitingFor: wait.ForLog("succeed to update max timestamp").
763+
WithOccurrence(3). // Wait for at least 3 region updates - indicates TiKV is ready
764+
WithStartupTimeout(180 * time.Second),
771765
},
772766
Started: true,
773767
})

0 commit comments

Comments
 (0)