2020import org .apache .fluss .cluster .Cluster ;
2121import org .apache .fluss .cluster .ServerNode ;
2222import org .apache .fluss .cluster .ServerType ;
23+ import org .apache .fluss .config .ConfigOptions ;
2324import org .apache .fluss .config .Configuration ;
2425import org .apache .fluss .exception .StaleMetadataException ;
2526import org .apache .fluss .rpc .RpcClient ;
@@ -51,12 +52,14 @@ void testInitializeClusterWithRetries() throws Exception {
5152 Configuration configuration = new Configuration ();
5253 RpcClient rpcClient =
5354 RpcClient .create (configuration , TestingClientMetricGroup .newInstance (), false );
55+ int times = configuration .getInt (ConfigOptions .CLIENT_METADATA_RETRY_TIMES );
56+ int interval = configuration .getInt (ConfigOptions .CLIENT_METADATA_RETRY_INTERVAL );
5457
5558 // retry lower than max retry count.
5659 AdminReadOnlyGateway gateway = new TestingAdminReadOnlyGateway (2 );
5760 Cluster cluster =
5861 MetadataUpdater .tryToInitializeClusterWithRetries (
59- rpcClient , CS_NODE , gateway , 3 , 100 );
62+ rpcClient , CS_NODE , gateway , times , interval );
6063 assertThat (cluster ).isNotNull ();
6164 assertThat (cluster .getCoordinatorServer ()).isEqualTo (CS_NODE );
6265 assertThat (cluster .getAliveTabletServerList ()).containsExactly (TS_NODE );
@@ -66,7 +69,7 @@ void testInitializeClusterWithRetries() throws Exception {
6669 assertThatThrownBy (
6770 () ->
6871 MetadataUpdater .tryToInitializeClusterWithRetries (
69- rpcClient , CS_NODE , gateway2 , 3 , 100 ))
72+ rpcClient , CS_NODE , gateway2 , times , interval ))
7073 .isInstanceOf (StaleMetadataException .class )
7174 .hasMessageContaining ("The metadata is stale." );
7275 }
0 commit comments