File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -614,3 +614,35 @@ def test_quorum_happy_timeouts(self, client_mock: MagicMock) -> None:
614614 client_mock ().should_commit .call_args .kwargs ["timeout" ],
615615 timedelta (seconds = 23 ),
616616 )
617+
618+ @patch ("torchft.manager.ManagerClient" , autospec = True )
619+ def test_quorum_skip_init (self , client_mock : MagicMock ) -> None :
620+ manager = self ._create_manager (use_async_quorum = False )
621+
622+ quorum = QuorumResult ()
623+ quorum .quorum_id = 123
624+ quorum .replica_rank = 1
625+ quorum .replica_world_size = 2
626+ quorum .recover_src_manager_address = "manager address"
627+ quorum .store_address = f"localhost:{ self .store .port } "
628+ quorum .max_step = 1
629+ quorum .max_rank = 1
630+ quorum .max_world_size = 2
631+ quorum .heal = False
632+
633+ client_mock ()._quorum .return_value = quorum
634+
635+ manager .start_quorum ()
636+ self .assertEqual (
637+ client_mock ()._quorum .call_args .kwargs ["init_sync" ], True
638+ )
639+
640+ manager .start_quorum (init_sync = True )
641+ self .assertEqual (
642+ client_mock ()._quorum .call_args .kwargs ["init_sync" ], True
643+ )
644+
645+ manager .start_quorum (init_sync = False )
646+ self .assertEqual (
647+ client_mock ()._quorum .call_args .kwargs ["init_sync" ], False
648+ )
You can’t perform that action at this time.
0 commit comments