Skip to content

Commit

Permalink
test: fix concurrent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Sep 6, 2023
1 parent 3847814 commit 4e51788
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
REGION_ID: ${{ vars.REGION_ID }}
USER_ID: ${{ secrets.USER_ID }}
ROOT_UID: ${{ secrets.ROOT_UID }}
CONCURRENT_ID: ${{ github.run_id }}

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 6 additions & 6 deletions python-sdk-functional-test/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ def _init_env(self):
self.region_id = self._read_key_from_env_or_config("REGION_ID")
self.user_id = self._read_key_from_env_or_config("USER_ID")
self.root_user_id = self._read_key_from_env_or_config("ROOT_UID")
if 'TRAVIS_JOB_NUMBER' in os.environ:
self.travis_concurrent = os.environ.get('TRAVIS_JOB_NUMBER').split(".")[-1]
if 'CONCURRENT_ID' in os.environ:
self.concurrent_id = os.environ.get('CONCURRENT_ID')
else:
self.travis_concurrent = "0"
self.default_ram_user_name = "RamUserForSDKCredentialsTest" + self.travis_concurrent
self.default_ram_role_name = "RamRoleForSDKTest" + self.travis_concurrent
self.default_role_session_name = "RoleSession" + self.travis_concurrent
self.concurrent_id = "0"
self.default_ram_user_name = "RamUserForSDKCredentialsTest" + self.concurrent_id
self.default_ram_role_name = "RamRoleForSDKTest" + self.concurrent_id
self.default_role_session_name = "RoleSession" + self.concurrent_id
self.ram_user_id = None
self.ram_policy_attched = False
self.ram_user_access_key_id = None
Expand Down

0 comments on commit 4e51788

Please sign in to comment.