Skip to content

Commit 1e6915d

Browse files
authored
Fix broken test test_gcp_disk_tier (#5393)
* fix test case * pass instance type
1 parent 975d58a commit 1e6915d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/smoke_tests/test_cluster_job.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1702,9 +1702,10 @@ def _get_aws_query_command(region: str, instance_id: str, field: str,
17021702

17031703

17041704
@pytest.mark.gcp
1705-
def test_gcp_disk_tier():
1705+
@pytest.mark.parametrize('instance_type', ['n2-standard-64'])
1706+
def test_gcp_disk_tier(instance_type: str):
17061707
for disk_tier in list(resources_utils.DiskTier):
1707-
disk_types = [GCP._get_disk_type(disk_tier)]
1708+
disk_types = [GCP._get_disk_type(instance_type, disk_tier)]
17081709
name = smoke_tests_utils.get_cluster_name() + '-' + disk_tier.value
17091710
name_on_cloud = common_utils.make_cluster_name_on_cloud(
17101711
name, sky.GCP.max_cluster_name_length())
@@ -1714,10 +1715,12 @@ def test_gcp_disk_tier():
17141715
# Ultra disk tier requires n2 instance types to have more than 64 CPUs.
17151716
# If using default instance type, it will only enable the high disk tier.
17161717
disk_types = [
1717-
GCP._get_disk_type(resources_utils.DiskTier.HIGH),
1718-
GCP._get_disk_type(resources_utils.DiskTier.ULTRA),
1718+
GCP._get_disk_type(instance_type,
1719+
resources_utils.DiskTier.HIGH),
1720+
GCP._get_disk_type(instance_type,
1721+
resources_utils.DiskTier.ULTRA),
17191722
]
1720-
instance_type_options = ['', '--instance-type n2-standard-64']
1723+
instance_type_options = ['', f'--instance-type {instance_type}']
17211724
for disk_type, instance_type_option in zip(disk_types,
17221725
instance_type_options):
17231726
test = smoke_tests_utils.Test(

0 commit comments

Comments
 (0)