Skip to content

Commit

Permalink
locustio#1884 change to snake_case style
Browse files Browse the repository at this point in the history
  • Loading branch information
tyge68 committed Sep 15, 2021
1 parent 2ee523e commit d1b2597
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,42 +714,42 @@ def addWorker():
addWorker()

@retry(AssertionError, tries=10, delay=0.5)
def checkRebalancedTrue():
def check_rebalanced_true():
for worker in workers:
self.assertTrue(worker.user_count > 0)

# Check that all workers have a user count > 0 at least
checkRebalancedTrue()
check_rebalanced_true()
# Add 2 more workers (should be 6 now)
addWorker()
addWorker()

@retry(AssertionError, tries=10, delay=0.5)
def checkRebalancedEquals():
def check_rebalanced_equals():
for worker in workers:
self.assertEqual(1, worker.user_count)

# Check that all workers have a user count = 1 now
checkRebalancedEquals()
check_rebalanced_equals()

# Simulate that some workers are missing by "killing" them abrutly
for i in range(3):
workers[i].greenlet.kill(block=True)

@retry(AssertionError, tries=10, delay=1)
def checkMasterWorkerMissingCount():
def check_master_worker_missing_count():
self.assertEqual(3, len(master.clients.missing))

# Check that master detected the missing workers
checkMasterWorkerMissingCount()
check_master_worker_missing_count()

@retry(AssertionError, tries=10, delay=1)
def checkRemaingWorkerNewUserCount():
def check_remaing_workers_new_users_count():
for i in range(3, 6):
self.assertEqual(2, workers[i].user_count)

# Check that remaining workers have a new count of user due to rebalancing.
checkRemaingWorkerNewUserCount()
check_remaing_workers_new_users_count()
sleep(1)

# Finally quit and check states of remaining workers.
Expand Down

0 comments on commit d1b2597

Please sign in to comment.