Skip to content

Commit 53ec8be

Browse files
committed
lint
1 parent 8aed1fc commit 53ec8be

File tree

4 files changed

+45
-32
lines changed

4 files changed

+45
-32
lines changed

src/interceptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use tonic::{service::Interceptor, metadata::MetadataValue, Request, Status};
1+
use tonic::{metadata::MetadataValue, service::Interceptor, Request, Status};
22

33
/// Attaches user-assigned room-id header to every outbound RPC
44
#[derive(Clone)]

src/lighthouse.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ mod tests {
977977
quorum_tick_ms: 10,
978978
heartbeat_timeout_ms: 5000,
979979
};
980-
let lighthouse = Lighthouse::new(opt).await?;
980+
let lighthouse = Lighthouse::new("".to_string(), opt).await?;
981981

982982
let lighthouse_task = tokio::spawn(lighthouse.clone().run());
983983

@@ -1135,7 +1135,7 @@ mod tests {
11351135
};
11361136

11371137
// Start the lighthouse service
1138-
let lighthouse = Lighthouse::new(opt).await?;
1138+
let lighthouse = Lighthouse::new("".to_string(), opt).await?;
11391139
let lighthouse_task = tokio::spawn(lighthouse.clone().run());
11401140

11411141
// Create client to interact with lighthouse
@@ -1242,7 +1242,7 @@ mod tests {
12421242
};
12431243

12441244
// Start the lighthouse service
1245-
let lighthouse = Lighthouse::new(opt).await?;
1245+
let lighthouse = Lighthouse::new("".to_string(), opt).await?;
12461246
let lighthouse_task = tokio::spawn(lighthouse.clone().run());
12471247

12481248
// Create client to interact with lighthouse

src/manager.rs

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -544,13 +544,16 @@ mod tests {
544544

545545
#[tokio::test]
546546
async fn test_should_commit() -> Result<()> {
547-
let lighthouse = Lighthouse::new(LighthouseOpt {
548-
bind: "[::]:0".to_string(),
549-
join_timeout_ms: 100,
550-
min_replicas: 1,
551-
quorum_tick_ms: 100,
552-
heartbeat_timeout_ms: 5000,
553-
})
547+
let lighthouse = Lighthouse::new(
548+
"".to_string(),
549+
LighthouseOpt {
550+
bind: "[::]:0".to_string(),
551+
join_timeout_ms: 100,
552+
min_replicas: 1,
553+
quorum_tick_ms: 100,
554+
heartbeat_timeout_ms: 5000,
555+
},
556+
)
554557
.await?;
555558
let lighthouse_fut = tokio::spawn(lighthouse.clone().run());
556559

@@ -591,13 +594,16 @@ mod tests {
591594

592595
#[tokio::test]
593596
async fn test_get_quorum() -> Result<()> {
594-
let lighthouse = Lighthouse::new(LighthouseOpt {
595-
bind: "[::]:0".to_string(),
596-
join_timeout_ms: 100,
597-
min_replicas: 1,
598-
quorum_tick_ms: 100,
599-
heartbeat_timeout_ms: 5000,
600-
})
597+
let lighthouse = Lighthouse::new(
598+
"".to_string(),
599+
LighthouseOpt {
600+
bind: "[::]:0".to_string(),
601+
join_timeout_ms: 100,
602+
min_replicas: 1,
603+
quorum_tick_ms: 100,
604+
heartbeat_timeout_ms: 5000,
605+
},
606+
)
601607
.await?;
602608
let lighthouse_fut = tokio::spawn(lighthouse.clone().run());
603609

@@ -646,13 +652,16 @@ mod tests {
646652

647653
#[tokio::test]
648654
async fn test_get_quorum_heal_first_step() -> Result<()> {
649-
let lighthouse = Lighthouse::new(LighthouseOpt {
650-
bind: "[::]:0".to_string(),
651-
join_timeout_ms: 100,
652-
min_replicas: 2,
653-
quorum_tick_ms: 100,
654-
heartbeat_timeout_ms: 5000,
655-
})
655+
let lighthouse = Lighthouse::new(
656+
"".to_string(),
657+
LighthouseOpt {
658+
bind: "[::]:0".to_string(),
659+
join_timeout_ms: 100,
660+
min_replicas: 2,
661+
quorum_tick_ms: 100,
662+
heartbeat_timeout_ms: 5000,
663+
},
664+
)
656665
.await?;
657666
let lighthouse_fut = tokio::spawn(lighthouse.clone().run());
658667

@@ -718,13 +727,16 @@ mod tests {
718727

719728
#[tokio::test]
720729
async fn test_checkpoint_metadata() -> Result<()> {
721-
let lighthouse = Lighthouse::new(LighthouseOpt {
722-
bind: "[::]:0".to_string(),
723-
join_timeout_ms: 100,
724-
min_replicas: 1,
725-
quorum_tick_ms: 100,
726-
heartbeat_timeout_ms: 5000,
727-
})
730+
let lighthouse = Lighthouse::new(
731+
"".to_string(),
732+
LighthouseOpt {
733+
bind: "[::]:0".to_string(),
734+
join_timeout_ms: 100,
735+
min_replicas: 1,
736+
quorum_tick_ms: 100,
737+
heartbeat_timeout_ms: 5000,
738+
},
739+
)
728740
.await?;
729741
let lighthouse_fut = tokio::spawn(lighthouse.clone().run());
730742

torchft/_torchft.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class Quorum:
8989
class LighthouseClient:
9090
addr: str
9191
connect_timeout: timedelta
92+
room_id: Optional[str] = None
9293

9394
def quorum(
9495
self,

0 commit comments

Comments
 (0)