Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions test/integration/models/account/test_account.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import time
from datetime import datetime
from test.integration.conftest import get_region
from test.integration.helpers import get_test_label, retry_sending_request
from test.integration.helpers import (
get_test_label,
retry_sending_request,
wait_for_condition,
)

import pytest

Expand Down Expand Up @@ -102,13 +106,18 @@ def test_latest_get_event(test_linode_client, e2e_test_firewall):
firewall=e2e_test_firewall,
)

events = client.load(Event, "")
def get_linode_status():
return linode.status == "running"

latest_events = events._raw_json.get("data")
# To ensure the Linode is running and the 'event' key has been populated
wait_for_condition(3, 100, get_linode_status)

events = client.load(Event, "")
latest_events = events._raw_json.get("data")[:15]

linode.delete()

for event in latest_events[:15]:
for event in latest_events:
if label == event["entity"]["label"]:
break
else:
Expand Down
4 changes: 2 additions & 2 deletions test/integration/models/domain/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def test_clone(test_linode_client, test_domain):
dom = "example.clone-" + timestamp + "-inttestsdk.org"
domain.clone(dom)

ds = test_linode_client.domains()

time.sleep(1)

ds = test_linode_client.domains()

domains = [i.domain for i in ds]

assert dom in domains
Expand Down
6 changes: 6 additions & 0 deletions test/integration/models/linode/test_linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,12 @@ def test_linode_initate_migration(test_linode_client, e2e_test_firewall):
migration_type=MigrationType.COLD,
)

def get_linode_status():
return linode.status == "offline"

# To verify that Linode's status changed before deletion (during migration status is set to 'offline')
wait_for_condition(5, 120, get_linode_status)

res = linode.delete()

assert res
Expand Down
9 changes: 6 additions & 3 deletions test/integration/models/networking/test_networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)


def create_linode(test_linode_client):
def create_linode_func(test_linode_client):
client = test_linode_client

label = get_test_label()
Expand All @@ -49,7 +49,7 @@ def create_linode(test_linode_client):

@pytest.fixture
def create_linode_for_ip_share(test_linode_client):
linode = create_linode(test_linode_client)
linode = create_linode_func(test_linode_client)

yield linode

Expand All @@ -58,7 +58,7 @@ def create_linode_for_ip_share(test_linode_client):

@pytest.fixture
def create_linode_to_be_shared_with_ips(test_linode_client):
linode = create_linode(test_linode_client)
linode = create_linode_func(test_linode_client)

yield linode

Expand Down Expand Up @@ -302,6 +302,8 @@ def test_create_and_delete_vlan(test_linode_client, linode_for_vlan_tests):
wait_for_condition(3, 100, get_status, linode, "rebooting")
assert linode.status == "rebooting"

wait_for_condition(3, 100, get_status, linode, "running")

# Delete the VLAN
is_deleted = test_linode_client.networking.delete_vlan(
vlan_label, linode.region
Expand Down Expand Up @@ -334,6 +336,7 @@ def test_get_global_firewall_settings(test_linode_client):

def test_ip_info(test_linode_client, create_linode):
linode = create_linode
wait_for_condition(3, 100, get_status, linode, "running")

ip_info = test_linode_client.load(IPAddress, linode.ipv4[0])

Expand Down