Skip to content

Commit

Permalink
blacken
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackmin801 committed Jan 9, 2025
1 parent 13e72f1 commit b4caa97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions torchft/lighthouse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from torchft import Manager, ProcessGroupGloo
import time


class TestLighthouse(TestCase):
def test_join_timeout_behavior(self) -> None:
"""Test that join_timeout_ms affects joining behavior"""
Expand All @@ -14,7 +15,7 @@ def test_join_timeout_behavior(self) -> None:
min_replicas=1,
join_timeout_ms=100,
)

# Create a manager that tries to join
try:
store = dist.TCPStore(
Expand All @@ -37,7 +38,7 @@ def test_join_timeout_behavior(self) -> None:
use_async_quorum=False,
lighthouse_addr=lighthouse.address(),
)

start_time = time.time()
manager.start_quorum()
time_taken = time.time() - start_time
Expand All @@ -46,15 +47,15 @@ def test_join_timeout_behavior(self) -> None:
finally:
# Cleanup
lighthouse.shutdown()
if 'manager' in locals():
if "manager" in locals():
manager.shutdown()

lighthouse = Lighthouse(
bind="[::]:0",
min_replicas=1,
join_timeout_ms=400,
)

# Create a manager that tries to join
try:
store = dist.TCPStore(
Expand All @@ -77,7 +78,7 @@ def test_join_timeout_behavior(self) -> None:
use_async_quorum=False,
lighthouse_addr=lighthouse.address(),
)

start_time = time.time()
manager.start_quorum()
time_taken = time.time() - start_time
Expand All @@ -86,6 +87,5 @@ def test_join_timeout_behavior(self) -> None:
finally:
# Cleanup
lighthouse.shutdown()
if 'manager' in locals():
if "manager" in locals():
manager.shutdown()

0 comments on commit b4caa97

Please sign in to comment.