Skip to content

Commit c95040a

Browse files
authored
Fix test_gcp_disk_tier (#5592)
make instance type consistent
1 parent c7068a2 commit c95040a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/smoke_tests/test_cluster_job.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import re
2424
import tempfile
2525
import textwrap
26-
from typing import Dict
26+
from typing import Dict, List
2727

2828
import jinja2
2929
import pytest
@@ -1701,9 +1701,19 @@ def _get_aws_query_command(region: str, instance_id: str, field: str,
17011701

17021702

17031703
@pytest.mark.gcp
1704-
@pytest.mark.parametrize('instance_type', ['n2-standard-64'])
1705-
def test_gcp_disk_tier(instance_type: str):
1704+
@pytest.mark.parametrize('instance_types',
1705+
[['n2-standard-2', 'n2-standard-64']])
1706+
def test_gcp_disk_tier(instance_types: List[str]):
1707+
instance_type_low, instance_type_high = instance_types
17061708
for disk_tier in list(resources_utils.DiskTier):
1709+
# GCP._get_disk_type returns pd-extreme only for instance types with >= 64
1710+
# CPUs. We must ensure the launched instance type matches what we pass to
1711+
# GCP._get_disk_type.
1712+
if disk_tier == resources_utils.DiskTier.BEST:
1713+
instance_type = instance_type_high
1714+
else:
1715+
instance_type = instance_type_low
1716+
17071717
disk_types = [GCP._get_disk_type(instance_type, disk_tier)]
17081718
name = smoke_tests_utils.get_cluster_name() + '-' + disk_tier.value
17091719
name_on_cloud = common_utils.make_cluster_name_on_cloud(

0 commit comments

Comments
 (0)