Skip to content

Commit

Permalink
Improve testing
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed May 16, 2024
1 parent 04dfccb commit 227d5ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/integration/tests/test_control_plane_taints.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def test_control_plane_taints(instances: List[harness.Instance]):
)

k8s_instance.exec(["k8s", "bootstrap", "--file", "/root/config.yaml"])
while not (nodes := util.get_nodes(k8s_instance)):
retries = 10
while retries and not (nodes := util.get_nodes(k8s_instance)):
LOG.info("Waiting for Nodes")
time.sleep(5)

time.sleep(3)
retries -= 1
assert len(nodes) == 1, "Should have found one node in 30 sec"
assert all([
t["effect"] == "NoSchedule"
for t in nodes[0]["spec"]["taints"]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def get_nodes(control_node: harness.Instance) -> List[Any]:
node_list = json.loads(result.stdout.decode())
assert node_list["kind"] == "List", "Should have found a list of nodes"
return [node for node in node_list["items"]]


def ready_nodes(control_node: harness.Instance) -> List[Any]:
"""Get a list of the ready nodes.
Expand Down

0 comments on commit 227d5ac

Please sign in to comment.