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
2 changes: 1 addition & 1 deletion test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def get_domain_status():
domain.invalidate()
return domain.status == "active"

wait_for_condition(3, 30, get_domain_status)
wait_for_condition(3, 45, get_domain_status)

# Create a SRV record
domain.record_create(
Expand Down
9 changes: 7 additions & 2 deletions test/integration/models/account/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def test_get_account(test_linode_client):
assert account_get.tax_id == account.tax_id


@pytest.mark.skip(
reason="Test fails for test user with [504] Gateway Timeout. More details: ARB-7420"
)
def test_get_login(test_linode_client):
client = test_linode_client
login = retry_sending_request(3, client.load, Login(client, "", {}), "")
Expand Down Expand Up @@ -91,6 +94,8 @@ def test_update_maintenance_policy(test_linode_client):
assert updated.maintenance_policy == original_policy


# May fail due to multiple events occurring on the test user in the same time
@pytest.mark.flaky(reruns=2, reruns_delay=5)
@pytest.mark.smoke
def test_latest_get_event(test_linode_client, e2e_test_firewall):
client = test_linode_client
Expand All @@ -115,15 +120,15 @@ def get_linode_status():
wait_for_condition(5, 150, get_linode_status)

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

linode.delete()

for event in latest_events:
if label == event["entity"]["label"]:
break
else:
assert False, f"Linode '{label}' not found in the last 15 events"
assert False, f"Linode '{label}' not found in the last 50 events"


def test_get_user(test_linode_client):
Expand Down
13 changes: 11 additions & 2 deletions test/integration/models/linode/test_linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,17 @@ def test_linode_ips(create_linode):

def test_linode_initate_migration(test_linode_client, e2e_test_firewall):
client = test_linode_client
region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core")
label = get_test_label() + "_migration"
region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core")
region_migrate = get_region(
client, {"Linodes", "Cloud Firewall"}, site_type="core"
)

# Cannot migrate linode to the same region
while region_migrate == region:
region_migrate = get_region(
client, {"Linodes", "Cloud Firewall"}, site_type="core"
)

linode = client.linode.instance_create(
"g6-nanode-1",
Expand All @@ -657,7 +666,7 @@ def test_linode_initate_migration(test_linode_client, e2e_test_firewall):
send_request_when_resource_available(
300,
linode.initiate_migration,
region="us-central",
region=region_migrate,
migration_type=MigrationType.COLD,
)

Expand Down
4 changes: 2 additions & 2 deletions test/integration/models/networking/test_networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ def test_create_and_delete_vlan(test_linode_client, linode_for_vlan_tests):
config.interfaces = []
config.save()

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

retry_sending_request(3, linode.reboot)

wait_for_condition(3, 100, get_status, linode, "rebooting")
assert linode.status == "rebooting"

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

# Delete the VLAN
is_deleted = test_linode_client.networking.delete_vlan(
Expand Down
14 changes: 11 additions & 3 deletions test/integration/models/sharegroups/test_sharegroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest

from linode_api4.errors import ApiError
from linode_api4.objects import (
Image,
ImageShareGroup,
Expand Down Expand Up @@ -33,7 +34,7 @@ def wait_for_image_status(
)


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def sample_linode(test_linode_client, e2e_test_firewall):
client = test_linode_client
region = get_region(client, {"Linodes", "Cloud Firewall"}, site_type="core")
Expand All @@ -50,15 +51,22 @@ def sample_linode(test_linode_client, e2e_test_firewall):
linode_instance.delete()


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def create_image_id(test_linode_client, sample_linode):
create_image = test_linode_client.images.create(
sample_linode.disks[0],
label="linode-api4python-test-image-sharing-image",
)
wait_for_image_status(test_linode_client, create_image.id, "available")

yield create_image.id
create_image.delete()

try:
create_image.delete()
except ApiError as e:
# The image may already have been removed so we ignore [404] Not found
if e.status != 404:
raise


@pytest.fixture(scope="function")
Expand Down