Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apetenchea committed Oct 16, 2023
1 parent d62e094 commit 321a784
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
name: "Run pytest"
command: |
mkdir test-results
args=("--host" "localhost" "--complete" "--junitxml=test-results/junit.xml")
args=("--host" "localhost" "--junitxml=test-results/junit.xml")
if [ << parameters.cluster >> = true ]; then
args+=("--cluster" "--port=8529" "--port=8539" "--port=8549")
else
Expand Down
12 changes: 11 additions & 1 deletion tests/test_cluster.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import pytest
from packaging import version

Expand Down Expand Up @@ -174,7 +176,15 @@ def test_cluster_rebalance(sys_db, bad_db, cluster, db_version):
assert err.value.error_code == FORBIDDEN

# Test rebalance execution
assert sys_db.cluster.execute_rebalance_plan(rebalance["moves"]) is True
tries = 0
while sys_db.cluster.execute_rebalance_plan(rebalance["moves"]) is False:
if tries < 10:
tries += 1
time.sleep(0.5)
else:
tries = -1
break
assert tries != -1
with assert_raises(ClusterRebalanceError) as err:
bad_db.cluster.execute_rebalance_plan(rebalance["moves"])
assert err.value.error_code == FORBIDDEN
Expand Down
2 changes: 1 addition & 1 deletion tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_database_misc_methods(sys_db, db, bad_db, cluster):
assert err.value.error_code in {11, 1228}

# Test set log levels
new_levels = {"agency": "DEBUG", "collector": "INFO", "threads": "WARNING"}
new_levels = {"agency": "DEBUG", "engines": "INFO", "threads": "WARNING"}
result = sys_db.set_log_levels(**new_levels)
for key, value in new_levels.items():
assert result[key] == value
Expand Down

0 comments on commit 321a784

Please sign in to comment.