Skip to content

Commit 90b43ab

Browse files
authored
test: Address flaky tests in linode_client and lke (#412)
* unskip lke test, update test_lke_node_recycle, filter swap disk for image create, skip parent child account test * skip pc account test * remove comment * update with cleaner syntax
1 parent 1d5c181 commit 90b43ab

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

test/integration/linode_client/test_linode_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def test_image_create(setup_client_and_linode):
8686

8787
label = get_test_label()
8888
description = "Test description"
89-
disk_id = linode.disks.first().id
89+
usable_disk = [v for v in linode.disks if v.filesystem != "swap"]
9090

9191
image = client.image_create(
92-
disk=disk_id, label=label, description=description
92+
disk=usable_disk[0].id, label=label, description=description
9393
)
9494

9595
assert image.label == label

test/integration/models/account/test_account.py

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_get_user(test_linode_client):
9595

9696

9797
def test_list_child_accounts(test_linode_client):
98+
pytest.skip("Configure test account settings for Parent child")
9899
client = test_linode_client
99100
child_accounts = client.account.child_accounts()
100101
if len(child_accounts) > 0:

test/integration/models/lke/test_lke.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ def test_get_lke_clusters(test_linode_client, lke_cluster):
7878

7979

8080
def test_get_lke_pool(test_linode_client, lke_cluster):
81-
pytest.skip("TPT-2511")
8281
cluster = lke_cluster
8382

8483
pool = test_linode_client.load(LKENodePool, cluster.pools[0].id, cluster.id)
8584

86-
assert cluster.pools[0]._raw_json == pool
85+
assert cluster.pools[0].id == pool.id
8786

8887

8988
def test_cluster_dashboard_url_view(lke_cluster):
@@ -147,10 +146,11 @@ def test_lke_node_recycle(test_linode_client, lke_cluster):
147146
"ready",
148147
)
149148

150-
node_pool = test_linode_client.load(
151-
LKENodePool, cluster.pools[0].id, cluster.id
152-
)
153-
node = node_pool.nodes[0]
149+
# Reload cluster
150+
cluster = test_linode_client.load(LKECluster, lke_cluster.id)
151+
152+
node = cluster.pools[0].nodes[0]
153+
154154
assert node.status == "ready"
155155

156156

0 commit comments

Comments
 (0)