Skip to content

Commit 06581ed

Browse files
committed
test: update test
1 parent ac54857 commit 06581ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/meta-srv/src/election/postgres.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ mod tests {
733733
use tokio_postgres::{Client, NoTls};
734734

735735
use super::*;
736-
use crate::error::PostgresExecutionSnafu;
736+
use crate::{election::CANDIDATE_KEEP_ALIVE_INTERVAL_SECS, error::PostgresExecutionSnafu};
737737

738738
async fn create_postgres_client(table_name: Option<&str>) -> Result<Client> {
739739
let endpoint = env::var("GT_POSTGRES_ENDPOINTS").unwrap_or_default();
@@ -869,8 +869,11 @@ mod tests {
869869
start_time_ms: 0,
870870
};
871871

872+
pg_election.register_candidate(&node_info).await.unwrap();
873+
872874
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;
874877
}
875878
}
876879

0 commit comments

Comments
 (0)