File tree 1 file changed +5
-2
lines changed
src/meta-srv/src/election
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,7 @@ mod tests {
733
733
use tokio_postgres:: { Client , NoTls } ;
734
734
735
735
use super :: * ;
736
- use crate :: error:: PostgresExecutionSnafu ;
736
+ use crate :: { election :: CANDIDATE_KEEP_ALIVE_INTERVAL_SECS , error:: PostgresExecutionSnafu } ;
737
737
738
738
async fn create_postgres_client ( table_name : Option < & str > ) -> Result < Client > {
739
739
let endpoint = env:: var ( "GT_POSTGRES_ENDPOINTS" ) . unwrap_or_default ( ) ;
@@ -869,8 +869,11 @@ mod tests {
869
869
start_time_ms : 0 ,
870
870
} ;
871
871
872
+ pg_election. register_candidate ( & node_info) . await . unwrap ( ) ;
873
+
872
874
loop {
873
- pg_election. register_candidate ( & node_info) . await . unwrap ( ) ;
875
+ pg_election. candidate_keep_alive ( & node_info) . await . unwrap ( ) ;
876
+ tokio:: time:: sleep ( Duration :: from_secs ( CANDIDATE_KEEP_ALIVE_INTERVAL_SECS ) ) . await ;
874
877
}
875
878
}
876
879
You can’t perform that action at this time.
0 commit comments