From 4e517880f6913c820a4690797037ed316860f3aa Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Wed, 6 Sep 2023 23:49:59 +0800 Subject: [PATCH] test: fix concurrent issue --- .github/workflows/test.yml | 1 + python-sdk-functional-test/base.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd9e30f62c..1dd145b413 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/python-sdk-functional-test/base.py b/python-sdk-functional-test/base.py index 360c03fcc3..f5b5e2632b 100644 --- a/python-sdk-functional-test/base.py +++ b/python-sdk-functional-test/base.py @@ -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