Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] fix smoke test race condition on first run #4494

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aylei
Copy link

@aylei aylei commented Dec 20, 2024

Fix the following error when I ran pytest tests/test_smoke.py on my laptop, which cause test failure:

D 12-20 16:53:56 provisioner.py:153] Traceback (most recent call last):
D 12-20 16:53:56 provisioner.py:153]   File "/Users/aylei/repo/skypilot-org/skypilot/sky/provision/provisioner.py", line 142, in bulk_provision
D 12-20 16:53:56 provisioner.py:153]     return _bulk_provision(cloud, region, cluster_name,
D 12-20 16:53:56 provisioner.py:153]   File "/Users/aylei/repo/skypilot-org/skypilot/sky/provision/provisioner.py", line 60, in _bulk_provision
D 12-20 16:53:56 provisioner.py:153]     config = provision.bootstrap_instances(provider_name, region_name,
D 12-20 16:53:56 provisioner.py:153]   File "/Users/aylei/repo/skypilot-org/skypilot/sky/provision/__init__.py", line 52, in _wrapper
D 12-20 16:53:56 provisioner.py:153]     return impl(*args, **kwargs)
D 12-20 16:53:56 provisioner.py:153]   File "/Users/aylei/repo/skypilot-org/skypilot/sky/provision/aws/config.py", line 71, in bootstrap_instances
D 12-20 16:53:56 provisioner.py:153]     node_cfg['IamInstanceProfile'] = _configure_iam_role(iam)
D 12-20 16:53:56 provisioner.py:153]   File "/Users/aylei/repo/skypilot-org/skypilot/sky/provision/aws/config.py", line 161, in _configure_iam_role
D 12-20 16:53:56 provisioner.py:153]     iam.meta.client.create_instance_profile(
D 12-20 16:53:56 provisioner.py:153]   File "/opt/homebrew/anaconda3/envs/sky/lib/python3.10/site-packages/botocore/client.py", line 569, in _api_ca
ll
D 12-20 16:53:56 provisioner.py:153]     return self._make_api_call(operation_name, kwargs)
D 12-20 16:53:56 provisioner.py:153]   File "/opt/homebrew/anaconda3/envs/sky/lib/python3.10/site-packages/botocore/client.py", line 1023, in _make_
api_call
D 12-20 16:53:56 provisioner.py:153]     raise error_class(parsed_response, operation_name)
D 12-20 16:53:56 provisioner.py:153] botocore.errorfactory.EntityAlreadyExistsException: An error occurred (EntityAlreadyExists) when calling the Cr
eateInstanceProfile operation: Instance Profile skypilot-v1 already exists.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_aws_stale_job_manual_restart
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

@aylei aylei marked this pull request as ready for review December 20, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant