Skip to content

Commit 653f192

Browse files
committed
blacken
1 parent 13e72f1 commit 653f192

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

torchft/lighthouse_test.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import torch.distributed as dist
1+
import time
22
from unittest import TestCase
3-
from torchft.torchft import Lighthouse
3+
4+
import torch.distributed as dist
5+
46
from torchft import Manager, ProcessGroupGloo
5-
import time
7+
from torchft.torchft import Lighthouse
8+
69

710
class TestLighthouse(TestCase):
811
def test_join_timeout_behavior(self) -> None:
@@ -14,7 +17,7 @@ def test_join_timeout_behavior(self) -> None:
1417
min_replicas=1,
1518
join_timeout_ms=100,
1619
)
17-
20+
1821
# Create a manager that tries to join
1922
try:
2023
store = dist.TCPStore(
@@ -37,7 +40,7 @@ def test_join_timeout_behavior(self) -> None:
3740
use_async_quorum=False,
3841
lighthouse_addr=lighthouse.address(),
3942
)
40-
43+
4144
start_time = time.time()
4245
manager.start_quorum()
4346
time_taken = time.time() - start_time
@@ -46,15 +49,15 @@ def test_join_timeout_behavior(self) -> None:
4649
finally:
4750
# Cleanup
4851
lighthouse.shutdown()
49-
if 'manager' in locals():
52+
if "manager" in locals():
5053
manager.shutdown()
51-
54+
5255
lighthouse = Lighthouse(
5356
bind="[::]:0",
5457
min_replicas=1,
5558
join_timeout_ms=400,
5659
)
57-
60+
5861
# Create a manager that tries to join
5962
try:
6063
store = dist.TCPStore(
@@ -77,7 +80,7 @@ def test_join_timeout_behavior(self) -> None:
7780
use_async_quorum=False,
7881
lighthouse_addr=lighthouse.address(),
7982
)
80-
83+
8184
start_time = time.time()
8285
manager.start_quorum()
8386
time_taken = time.time() - start_time
@@ -86,6 +89,5 @@ def test_join_timeout_behavior(self) -> None:
8689
finally:
8790
# Cleanup
8891
lighthouse.shutdown()
89-
if 'manager' in locals():
92+
if "manager" in locals():
9093
manager.shutdown()
91-

0 commit comments

Comments
 (0)