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

test_classic_cdn_migration_commit playback test fails: TypeError: super(type, obj): obj must be an instance or subtype of type #30577

Closed
jiasli opened this issue Dec 25, 2024 · 2 comments · Fixed by #30578
Assignees
Labels
Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@jiasli
Copy link
Member

jiasli commented Dec 25, 2024

https://dev.azure.com/azclitools/public/_build/results?buildId=212967&view=logs&j=3791f883-8843-5e94-fc79-c8ca993c0a42&t=fc099b28-42bc-5603-6ee8-d61b88ef47c8&l=1120

2024-12-25T09:28:59.3053197Z =================================== FAILURES ===================================
2024-12-25T09:28:59.3053901Z ____________ ClassicCdnMigration.test_classic_cdn_migration_commit _____________
2024-12-25T09:28:59.3054389Z [gw0] linux -- Python 3.12.8 /mnt/vss/_work/1/s/env/bin/python
2024-12-25T09:28:59.3054671Z self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f70c6e2da00>
2024-12-25T09:28:59.3054972Z cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f70ccc448c0>
2024-12-25T09:28:59.3055291Z command = 'cdn profile-migration commit -g clitest.rg000001 --profile-name profile000002'
2024-12-25T09:28:59.3055559Z expect_failure = False
2024-12-25T09:28:59.3055637Z 
2024-12-25T09:28:59.3055890Z     def _in_process_execute(self, cli_ctx, command, expect_failure=False):
2024-12-25T09:28:59.3056365Z         from io import StringIO
2024-12-25T09:28:59.3056617Z         from vcr.errors import CannotOverwriteExistingCassetteException
2024-12-25T09:28:59.3056855Z     
2024-12-25T09:28:59.3057054Z         if command.startswith('az '):
2024-12-25T09:28:59.3057268Z             command = command[3:]
2024-12-25T09:28:59.3057445Z     
2024-12-25T09:28:59.3057629Z         stdout_buf = StringIO()
2024-12-25T09:28:59.3057832Z         logging_buf = StringIO()
2024-12-25T09:28:59.3058022Z         try:
2024-12-25T09:28:59.3058278Z             # issue: stderr cannot be redirect in this form, as a result some failure information
2024-12-25T09:28:59.3058553Z             # is lost when command fails.
2024-12-25T09:28:59.3058834Z >           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
2024-12-25T09:28:59.3058983Z 
2024-12-25T09:28:59.3059207Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
2024-12-25T09:28:59.3059628Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-12-25T09:28:59.3060091Z env/lib/python3.12/site-packages/knack/cli.py:245: in invoke
2024-12-25T09:28:59.3231302Z     exit_code = self.exception_handler(ex)
2024-12-25T09:28:59.3231619Z src/azure-cli-core/azure/cli/core/__init__.py:129: in exception_handler
2024-12-25T09:28:59.3231891Z     return handle_exception(ex)
2024-12-25T09:28:59.3232129Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-12-25T09:28:59.3232248Z 
2024-12-25T09:28:59.3232489Z ex = TypeError('super(type, obj): obj must be an instance or subtype of type')
2024-12-25T09:28:59.3232735Z args = (), kwargs = {}
2024-12-25T09:28:59.3232825Z 
2024-12-25T09:28:59.3233079Z     def _handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
2024-12-25T09:28:59.3233387Z         if isinstance(ex, CannotOverwriteExistingCassetteException):
2024-12-25T09:28:59.3233696Z             # This exception usually caused by a no match HTTP request. This is a product error
2024-12-25T09:28:59.3233989Z             # that is caused by change of SDK invocation.
2024-12-25T09:28:59.3234201Z             raise ex
2024-12-25T09:28:59.3234373Z     
2024-12-25T09:28:59.3234565Z >       raise CliExecutionError(ex)
2024-12-25T09:28:59.3234882Z E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception TypeError during execution and fails the command.
2024-12-25T09:28:59.3235078Z 
2024-12-25T09:28:59.3235315Z src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError
2024-12-25T09:28:59.3235456Z 
2024-12-25T09:28:59.3235686Z During handling of the above exception, another exception occurred:
2024-12-25T09:28:59.3235814Z 
2024-12-25T09:28:59.3236130Z self = <azure.cli.command_modules.cdn.tests.latest.test_classic_cdn_to_afd.ClassicCdnMigration testMethod=test_classic_cdn_migration_commit>
2024-12-25T09:28:59.3236478Z resource_group = 'clitest.rg000001'
2024-12-25T09:28:59.3236582Z 
2024-12-25T09:28:59.3236802Z     @ResourceGroupPreparer(additional_tags={'owner': 'jingnanxu'})
2024-12-25T09:28:59.3237094Z     def test_classic_cdn_migration_commit(self, resource_group):
2024-12-25T09:28:59.3237365Z         list_checks = [JMESPathCheck('length(@)', 0)]
2024-12-25T09:28:59.3237606Z         self.profile_list_cmd(resource_group, checks=list_checks)
2024-12-25T09:28:59.3237807Z     
2024-12-25T09:28:59.3238025Z         profile_name = self.create_random_name(prefix='profile', length=24)
2024-12-25T09:28:59.3238282Z         checks = [JMESPathCheck('name', profile_name),
2024-12-25T09:28:59.3238514Z                   JMESPathCheck('sku.name', 'Standard_Microsoft')]
2024-12-25T09:28:59.3238803Z         self.profile_create_cmd(resource_group, profile_name, sku='Standard_Microsoft', checks=checks)
2024-12-25T09:28:59.3239026Z     
2024-12-25T09:28:59.3239215Z         checks = [JMESPathCheck('canMigrate', True),
2024-12-25T09:28:59.3239456Z                   JMESPathCheck('type', 'Microsoft.Cdn/canmigrate')]
2024-12-25T09:28:59.3239906Z         self.cdn_can_migrate_to_afd(resource_group, profile_name, checks=checks)
2024-12-25T09:28:59.3240116Z     
2024-12-25T09:28:59.3240311Z         checks = [JMESPathCheck('type', 'Microsoft.Cdn/migrate')]
2024-12-25T09:28:59.3240597Z         self.cdn_migrate_to_afd(resource_group, profile_name, sku='Premium_AzureFrontDoor', checks=checks)
2024-12-25T09:28:59.3240835Z     
2024-12-25T09:28:59.3240994Z         time.sleep(30)
2024-12-25T09:28:59.3241149Z     
2024-12-25T09:28:59.3241349Z >       self.cdn_migration_commit(resource_group, profile_name)
2024-12-25T09:28:59.3241462Z 
2024-12-25T09:28:59.3241706Z src/azure-cli/azure/cli/command_modules/cdn/tests/latest/test_classic_cdn_to_afd.py:32: 
2024-12-25T09:28:59.3241994Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-12-25T09:28:59.3242285Z src/azure-cli/azure/cli/command_modules/cdn/tests/latest/scenario_mixin.py:435: in cdn_migration_commit
2024-12-25T09:28:59.3242702Z     return self.cmd(command, checks)
2024-12-25T09:28:59.3242944Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
2024-12-25T09:28:59.3243252Z     return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
2024-12-25T09:28:59.3243563Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in __init__
2024-12-25T09:28:59.3243851Z     self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
2024-12-25T09:28:59.3244138Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in _in_process_execute
2024-12-25T09:28:59.3244373Z     raise ex.exception
2024-12-25T09:28:59.3244616Z env/lib/python3.12/site-packages/knack/cli.py:233: in invoke
2024-12-25T09:28:59.3244866Z     cmd_result = self.invocation.execute(args)
2024-12-25T09:28:59.3245135Z src/azure-cli-core/azure/cli/core/commands/__init__.py:666: in execute
2024-12-25T09:28:59.3245361Z     raise ex
2024-12-25T09:28:59.3245605Z src/azure-cli-core/azure/cli/core/commands/__init__.py:734: in _run_jobs_serially
2024-12-25T09:28:59.3245891Z     results.append(self._run_job(expanded_arg, cmd_copy))
2024-12-25T09:28:59.3246170Z src/azure-cli-core/azure/cli/core/commands/__init__.py:714: in _run_job
2024-12-25T09:28:59.3246493Z     result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
2024-12-25T09:28:59.3246815Z src/azure-cli-core/azure/cli/core/commands/__init__.py:1063: in __call__
2024-12-25T09:28:59.3247063Z     result = poller.result()
2024-12-25T09:28:59.3247304Z src/azure-cli-core/azure/cli/core/aaz/_poller.py:108: in result
2024-12-25T09:28:59.3247528Z     self.wait(timeout)
2024-12-25T09:28:59.3247793Z env/lib/python3.12/site-packages/azure/core/tracing/decorator.py:94: in wrapper_use_tracer
2024-12-25T09:28:59.3248062Z     return func(*args, **kwargs)
2024-12-25T09:28:59.3248301Z src/azure-cli-core/azure/cli/core/aaz/_poller.py:130: in wait
2024-12-25T09:28:59.3248538Z     raise self._exception
2024-12-25T09:28:59.3248771Z src/azure-cli-core/azure/cli/core/aaz/_poller.py:83: in _start
2024-12-25T09:28:59.3249028Z     for polling_method in self._polling_generator:
2024-12-25T09:28:59.3249344Z src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/profile_migration/_commit.py:59: in _execute_operations
2024-12-25T09:28:59.3249658Z     yield self.ProfilesMigrationCommit(ctx=self.ctx)()
2024-12-25T09:28:59.3249955Z src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/cdn/profile_migration/_commit.py:75: in __call__
2024-12-25T09:28:59.3250274Z     session = self.client.send_request(request=request, stream=False, **kwargs)
2024-12-25T09:28:59.3250564Z src/azure-cli-core/azure/cli/core/aaz/_client.py:105: in send_request
2024-12-25T09:28:59.3250841Z     session = self._pipeline.run(request, stream=stream, **kwargs)
2024-12-25T09:28:59.3251123Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:229: in run
2024-12-25T09:28:59.3251385Z     return first_node.send(pipeline_request)
2024-12-25T09:28:59.3251649Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3252028Z     response = self.next.send(request)
2024-12-25T09:28:59.3252280Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3252519Z     response = self.next.send(request)
2024-12-25T09:28:59.3252778Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3253032Z     response = self.next.send(request)
2024-12-25T09:28:59.3253286Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3253537Z     response = self.next.send(request)
2024-12-25T09:28:59.3253795Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3254030Z     response = self.next.send(request)
2024-12-25T09:28:59.3254294Z env/lib/python3.12/site-packages/azure/mgmt/core/policies/_base.py:47: in send
2024-12-25T09:28:59.3254550Z     response = self.next.send(request)
2024-12-25T09:28:59.3254818Z env/lib/python3.12/site-packages/azure/core/pipeline/policies/_redirect.py:197: in send
2024-12-25T09:28:59.3255195Z     response = self.next.send(request)
2024-12-25T09:28:59.3255457Z env/lib/python3.12/site-packages/azure/core/pipeline/policies/_retry.py:532: in send
2024-12-25T09:28:59.3255716Z     response = self.next.send(request)
2024-12-25T09:28:59.3255961Z src/azure-cli-core/azure/cli/core/aaz/_http_policy.py:112: in send
2024-12-25T09:28:59.3256206Z     response = self.next.send(request)
2024-12-25T09:28:59.3256458Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3256715Z     response = self.next.send(request)
2024-12-25T09:28:59.3256976Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3257223Z     response = self.next.send(request)
2024-12-25T09:28:59.3257481Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3257725Z     response = self.next.send(request)
2024-12-25T09:28:59.3257978Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3258243Z     response = self.next.send(request)
2024-12-25T09:28:59.3258495Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:86: in send
2024-12-25T09:28:59.3258734Z     response = self.next.send(request)
2024-12-25T09:28:59.3258987Z env/lib/python3.12/site-packages/azure/core/pipeline/_base.py:118: in send
2024-12-25T09:28:59.3259284Z     self._sender.send(request.http_request, **request.context.options),
2024-12-25T09:28:59.3259602Z env/lib/python3.12/site-packages/azure/core/pipeline/transport/_requests_basic.py:355: in send
2024-12-25T09:28:59.3259883Z     response = self.session.request(  # type: ignore
2024-12-25T09:28:59.3260152Z env/lib/python3.12/site-packages/requests/sessions.py:589: in request
2024-12-25T09:28:59.3260409Z     resp = self.send(prep, **send_kwargs)
2024-12-25T09:28:59.3260654Z env/lib/python3.12/site-packages/requests/sessions.py:703: in send
2024-12-25T09:28:59.3260904Z     r = adapter.send(request, **kwargs)
2024-12-25T09:28:59.3261164Z env/lib/python3.12/site-packages/requests/adapters.py:667: in send
2024-12-25T09:28:59.3261398Z     resp = conn.urlopen(
2024-12-25T09:28:59.3261649Z env/lib/python3.12/site-packages/urllib3/connectionpool.py:715: in urlopen
2024-12-25T09:28:59.3261914Z     httplib_response = self._make_request(
2024-12-25T09:28:59.3262176Z env/lib/python3.12/site-packages/urllib3/connectionpool.py:416: in _make_request
2024-12-25T09:28:59.3262459Z     conn.request(method, url, **httplib_request_kw)
2024-12-25T09:28:59.3262692Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-12-25T09:28:59.3262795Z 
2024-12-25T09:28:59.3263011Z self = <urllib3.connection.HTTPSConnection object at 0x7f70c6dfddc0>
2024-12-25T09:28:59.3263230Z method = 'POST'
2024-12-25T09:28:59.3263571Z url = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Cdn/profiles/profile000002/migrationCommit?api-version=2024-09-01'
2024-12-25T09:28:59.3264013Z body = None
2024-12-25T09:28:59.3264425Z headers = {'User-Agent': 'AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-5.15.0-1074-azure-x86_64-with-glibc2.31)...t', 'ParameterSetName': '-g --profile-name', 'Authorization': 'Bearer top-secret-token-for-you', 'Content-Length': '0'}
2024-12-25T09:28:59.3264751Z 
2024-12-25T09:28:59.3264953Z     def request(self, method, url, body=None, headers=None):
2024-12-25T09:28:59.3265210Z         # Update the inner socket's timeout value to send the request.
2024-12-25T09:28:59.3265445Z         # This only triggers if the connection is re-used.
2024-12-25T09:28:59.3265665Z         if getattr(self, "sock", None) is not None:
2024-12-25T09:28:59.3265886Z             self.sock.settimeout(self.timeout)
2024-12-25T09:28:59.3266065Z     
2024-12-25T09:28:59.3266230Z         if headers is None:
2024-12-25T09:28:59.3266407Z             headers = {}
2024-12-25T09:28:59.3266564Z         else:
2024-12-25T09:28:59.3266769Z             # Avoid modifying the headers passed into .request()
2024-12-25T09:28:59.3267097Z             headers = headers.copy()
2024-12-25T09:28:59.3267337Z         if "user-agent" not in (six.ensure_str(k.lower()) for k in headers):
2024-12-25T09:28:59.3267597Z             headers["User-Agent"] = _get_default_user_agent()
2024-12-25T09:28:59.3267871Z >       super(HTTPConnection, self).request(method, url, body=body, headers=headers)
2024-12-25T09:28:59.3268150Z E       TypeError: super(type, obj): obj must be an instance or subtype of type
2024-12-25T09:28:59.3268293Z 
2024-12-25T09:28:59.3268516Z env/lib/python3.12/site-packages/urllib3/connection.py:244: TypeError
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 25, 2024

Thank you for opening this issue, we will look into it.

@jiasli
Copy link
Member Author

jiasli commented Dec 25, 2024

This issue is similar to #28678.

Other CDN tests have the same issue #30409 (comment). These tests were skipped by #30492.

@yonzhan yonzhan added this to the Backlog milestone Dec 25, 2024
@yonzhan yonzhan added the Service Attention This issue is responsible by Azure service team. label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants