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

Handle when transport has been garbage collected. #1193

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

fix: Handle when transport has been garbage collected.

2e5ca85
Select commit
Loading
Failed to load commit list.
Open

Handle when transport has been garbage collected. #1193

fix: Handle when transport has been garbage collected.
2e5ca85
Select commit
Loading
Failed to load commit list.
Azure Pipelines / Azure.azure-iot-sdk-python-dps-e2e failed Sep 3, 2024 in 4m 17s

Build #20240903.2 had test failures

Details

Tests

  • Failed: 2 (8.33%)
  • Passed: 18 (75.00%)
  • Other: 4 (16.67%)
  • Total: 24

Annotations

Check failure on line 343 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-iot-sdk-python-dps-e2e

Build log #L343

Bash exited with code '1'.

Check failure on line 1 in test_device_register_with_device_id_for_a_x509_individual_enrollment[mqtt]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-iot-sdk-python-dps-e2e

test_device_register_with_device_id_for_a_x509_individual_enrollment[mqtt]

Failed: Timeout >30.0s
Raw output
kwargs = {'protocol': 'mqtt'}
coro = <coroutine object test_device_register_with_device_id_for_a_x509_individual_enrollment at 0x7f2f609f8740>
task = <Task pending name='Task-1' coro=<test_device_register_with_device_id_for_a_x509_individual_enrollment() running at /h...async_certificate_enrollments.py:95> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f2f6096a640>()]>>

    @functools.wraps(func)
    def inner(**kwargs):
        coro = func(**kwargs)
        if coro is not None:
            task = asyncio.ensure_future(coro, loop=_loop)
            try:
>               _loop.run_until_complete(task)

/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pytest_asyncio/plugin.py:195: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/asyncio/base_events.py:603: in run_until_complete
    self.run_forever()
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/asyncio/base_events.py:570: in run_forever
    self._run_once()
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/asyncio/base_events.py:1823: in _run_once
    event_list = self._selector.select(timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selectors.EpollSelector object at 0x7f2f609e02b0>, timeout = -1

    def select(self, timeout=None):
        if timeout is None:
            timeout = -1
        elif timeout <= 0:
            timeout = 0
        else:
            # epoll_wait() has a resolution of 1 millisecond, round away
            # from zero to wait *at least* timeout seconds.
            timeout = math.ceil(timeout * 1e3) * 1e-3
    
        # epoll_wait() expects `maxevents` to be greater than zero;
        # we want to make sure that `select()` can be called when no
        # FD is registered.
        max_ev = max(len(self._fd_to_key), 1)
    
        ready = []
        try:
>           fd_event_list = self._selector.poll(timeout, max_ev)
E           Failed: Timeout >30.0s

/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/selectors.py:468: Failed

Check failure on line 1 in test_device_register_with_device_id_for_a_x509_individual_enrollment[mqttws]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / Azure.azure-iot-sdk-python-dps-e2e

test_device_register_with_device_id_for_a_x509_individual_enrollment[mqttws]

UnboundLocalError: local variable 'registration_id' referenced before assignment
Raw output
self = <provisioningserviceclient.client.ProvisioningServiceClient object at 0x7f2f61651af0>
provisioning_model = <provisioningserviceclient.protocol.models.individual_enrollment_py3.IndividualEnrollment object at 0x7f2f5c8d2f40>

    def create_or_update(self, provisioning_model):
        """
        Create or update an object on the Provisioning Service
    
        :param provisioning_model: The model of the object to be created/updated
        :type provisioning_model: :class:`IndividualEnrollment
         <provisioningserviceclient.models.IndividualEnrollment>` or :class:`EnrollmentGroup
         <provisioningserviceclient.models.EnrollmentGroup>`
    
        :returns: The model of the created/updated object as stored on the Provisiong Service
        :rtype: :class:`IndividualEnrollment
         <provisioningserviceclient.models.IndividualEnrollment>` or :class:`EnrollmentGroup
         <provisioningserviceclient.models.EnrollmentGroup>`
        :raises: TypeError if invalid provisioning model type or :class:`ProvisioningServiceError
         <provisioningserviceclient.ProvisioningServiceError>` if an error occurs on the
         Provisioning Service
        """
        if isinstance(provisioning_model, IndividualEnrollment):
            operation = self._runtime_client.create_or_update_individual_enrollment
            id = provisioning_model.registration_id
        elif isinstance(provisioning_model, EnrollmentGroup):
            operation = self._runtime_client.create_or_update_enrollment_group
            id = provisioning_model.enrollment_group_id
        else:
            raise TypeError("given object must be IndividualEnrollment or EnrollmentGroup")
    
        _unwrap_model(provisioning_model)
    
        try:
>           result = operation(id, provisioning_model, provisioning_model.etag)

/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/provisioningserviceclient/client.py:129: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <provisioningserviceclient.protocol.provisioning_service_client.ProvisioningServiceClient object at 0x7f2f61666e50>
id = 'e2edpslocomotorf2d64f2f-e0a7-43f0-b3ae-c7796ca246931'
enrollment = <provisioningserviceclient.protocol.models.individual_enrollment_py3.IndividualEnrollment object at 0x7f2f5c8d2f40>
if_match = None, custom_headers = None, raw = False, operation_config = {}
url = 'https://pythonv2jan-linux-westus.azure-devices-provisioning.net/enrollments/e2edpslocomotorf2d64f2f-e0a7-43f0-b3ae-c7796ca246931'
path_format_arguments = {'id': 'e2edpslocomotorf2d64f2f-e0a7-43f0-b3ae-c7796ca246931'}
query_parameters = {'api-version': '2018-09-01-preview'}
header_parameters = {'Accept': 'application/json', 'Content-Type': 'application/json; charset=utf-8'}
body_content = {'attestation': {'type': 'x509', 'x509': {'clientCertificates': {'primary': {'certificate': '-----BEGIN CERTIFICATE---...rbolt', 'provisioningStatus': 'enabled', 'registrationId': 'e2edpslocomotorf2d64f2f-e0a7-43f0-b3ae-c7796ca246931', ...}
request = <ClientRequest [PUT]>, response = <Response [409]>

    def create_or_update_individual_enrollment(
        self, id, enrollment, if_match=None, custom_headers=None, raw=False, **operation_config
    ):
        """Create or update a device enrollment record.
    
        :param id: The registration ID is alphanumeric, lowercase, and may
         contain hyphens.
        :type id: str
        :param enrollment: The device enrollment record.
        :type enrollment: ~protocol.models.IndividualEnrollment
        :param if_match: The ETag of the enrollment record.
        :type if_match: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: IndividualEnrollment or ClientRaw