Skip to content

PR #1219

PR #1219 #3572

GitHub Actions / JUnit Test Report failed Dec 11, 2024 in 0s

887 tests run, 866 passed, 6 skipped, 15 failed.

Annotations

Check failure on line 275 in endorser/tests/test_endorser_processor.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_endorser_processor.test_process_endorsement_event_governance

AttributeError: 'bool' object has no attribute 'model_dump'
Raw output
endorsement_processor_mock = <endorser.services.endorsement_processor.EndorsementProcessor object at 0x7fb8fc94dfa0>

    @pytest.mark.anyio
    async def test_process_endorsement_event_governance(endorsement_processor_mock):
        governance = GOVERNANCE_LABEL
        event_dict = {
            "origin": governance,
            "wallet_id": governance,
            "topic": "endorsements",
            "payload": {"state": "request-received", "transaction_id": "txn1"},
        }
    
        event_json = json.dumps(event_dict)
    
        with patch(
            "endorser.services.endorsement_processor.should_accept_endorsement"
        ) as mock_should_accept_endorsement, patch(
            "endorser.services.endorsement_processor.accept_endorsement"
        ) as mock_accept_endorsement:
            mock_should_accept_endorsement.return_value = True
            mock_accept_endorsement.return_value = AsyncMock()
>           await endorsement_processor_mock._process_endorsement_event(event_json)

endorser/tests/test_endorser_processor.py:275: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <endorser.services.endorsement_processor.EndorsementProcessor object at 0x7fb8fc94dfa0>
event_json = '{"origin": "didx", "wallet_id": "didx", "topic": "endorsements", "payload": {"state": "request-received", "transaction_id": "txn1"}}'

    async def _process_endorsement_event(self, event_json: str) -> None:
        """
        Processes an individual endorsement event, evaluating if it should be accepted and then endorsing as governance
    
        Args:
            event_json: The JSON string representation of the endorsement event.
        """
        event = parse_json_with_error_handling(
            CloudApiWebhookEventGeneric, event_json, logger
        )
        logger.debug("Processing endorsement event for agent `{}`", event.origin)
    
        # We're only interested in events from the governance agent
        if event.wallet_id != GOVERNANCE_LABEL:
            logger.warning("Endorsement request is not for governance agent.")
            return
    
        endorsement = Endorsement(**event.payload)
        transaction_id = endorsement.transaction_id
    
        async with AcaPyClient(
            base_url=GOVERNANCE_AGENT_URL, api_key=GOVERNANCE_AGENT_API_KEY
        ) as client:
            # Check if endorsement request is indeed applicable
            transaction = await should_accept_endorsement(client, transaction_id)
            if not transaction:
                logger.info(  # The check has already logged the reason as warning
                    "Endorsement request with transaction id `{}` is not applicable for endorsement.",
                    transaction_id,
                )
                return
    
            logger.info(
                "Endorsement request is applicable for endorsement, accepting transaction: {}",
>               transaction.model_dump(exclude={"messages_attach"}),
            )
E           AttributeError: 'bool' object has no attribute 'model_dump'

endorser/services/endorsement_processor.py:152: AttributeError

Check failure on line 89 in app/tests/e2e/test_did_exchange.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_did_exchange.test_create_did_exchange_request[clean-clean-None-None-False]

app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c45208f0>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c41c4a40>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c4520470>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c41a3d10>
use_did = None, use_did_method = None, use_public_did = False

    @pytest.mark.anyio
    @pytest.mark.parametrize(
        "use_did,use_did_method,use_public_did",
        [
            (None, None, False),
            (True, None, False),
            (None, "did:peer:2", False),
            (None, "did:peer:4", False),
            (True, "did:peer:4", False),
            (None, None, True),
        ],
    )
    async def test_create_did_exchange_request(
        alice_member_client: RichAsyncClient,
        faber_client: RichAsyncClient,
        alice_acapy_client: AcaPyClient,
        faber_acapy_client: AcaPyClient,
        use_did: Optional[str],
        use_did_method: Optional[str],
        use_public_did: bool,
    ):
        faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
    
        request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
    
        if use_did:
            new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
            request_data["use_did"] = new_did.did
    
        if use_did_method:
            request_data["use_did_method"] = use_did_method
    
        if use_public_did:
            request_data["use_public_did"] = use_public_did
    
        if use_public_did:  # Alice doesn't have a public DID
            with pytest.raises(HTTPException) as exc_info:
                response = await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
    
        elif use_did and use_did_method:
            with pytest.raises(HTTPException) as exc_info:
                await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert (
                exc_info.value.detail
                == """{"detail":"Cannot specify both use_did and use_did_method."}"""
            )
        else:
            response = await alice_member_client.post(
                f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
            )
            assert response.status_code == 200
            connection_record = response.json()
            assert_that(connection_record).contains("connection_id", "state")
            assert_that(connection_record["state"]).is_equal_to("request-sent")
    
            alice_connection_id = connection_record["connection_id"]
            alice_did = connection_record["my_did"]
    
            try:
                # Due to auto-accepts, Alice's connection is complete
>               assert await check_webhook_state(
                    alice_member_client,
                    topic="connections",
                    state="completed",
                    filter_map={"connection_id": alice_connection_id},
                )

app/tests/e2e/test_did_exchange.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:58: in check_webhook_state
    event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.tests.util.sse_listener.SseListener object at 0x7f60c41a3920>
field = 'connection_id', field_id = 'af4b6964-7bb3-4356-8a6b-1773f19c9772'
desired_state = 'completed', timeout = Timeout(timeout=30)

    async def wait_for_event(
        self,
        field,
        field_id,
        desired_state,
        timeout: int = DEFAULT_LISTENER_TIMEOUT,
    ) -> Dict[str, Any]:
        """
        Start listening for SSE events. When an event is received that matches the specified parameters.
        """
        url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}?look_back=5"
    
        timeout = Timeout(timeout)
        async with RichAsyncClient(timeout=timeout) as client:
            async with client.stream("GET", url) as response:
                async for line in response.aiter_lines():
                    if line.startswith("data: "):
                        data = json.loads(line[6:])
                        return data["payload"]
                    elif line == "" or line.startswith(": ping"):
                        pass  # ignore newlines and pings
                    else:
                        logger.warning("Unexpected SSE line: {}", line)
    
>       raise SseListenerTimeout("Requested filtered event was not returned by server.")
E       app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.

app/tests/util/sse_listener.py:56: SseListenerTimeout

Check failure on line 175 in app/tests/e2e/test_definitions.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_definitions.test_create_credential_definition_issuer_tenant[clean-clean-True]

app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fbcc2fc3bc0>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:489: in wait_for_active_registry
    await asyncio.sleep(sleep_duration)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.5, result = None

    async def sleep(delay, result=None):
        """Coroutine that completes after a given time (in seconds)."""
        if delay <= 0:
            await __sleep0()
            return result
    
        loop = events.get_running_loop()
        future = loop.create_future()
        h = loop.call_later(delay,
                            futures._set_result_unless_cancelled,
                            future, result)
        try:
>           return await future
E           asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/asyncio/tasks.py:665: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fbcc2b53bc0>
credential_definition_id = '3DXDamaSyLDymwdfc7gVUA:3:CL:3308:DKNIL'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fbcc3785240>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

schema_definition = CredentialSchema(id='Bo9W24g9VmLCnWopu5LJJm:2:test_schema:23.14.56', name='test_schema', version='23.14.56', attribute_names=['speed', 'name', 'age'])
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fbccd792b70>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fbcc2b52780>
support_revocation = True

    @pytest.mark.anyio
    @pytest.mark.parametrize("support_revocation", [False, True])
    @pytest.mark.skipif(
        TestMode.regression_run in TestMode.fixture_params,
        reason=(
            "Mystery -- this test passes continuously if it's the only test, "
            "but it fails when run a 2nd time in regression mode"
        ),
    )
    async def test_create_credential_definition_issuer_tenant(
        schema_definition: CredentialSchema,
        faber_acapy_client: AcaPyClient,
        faber_client: RichAsyncClient,
        support_revocation: bool,
    ):
        credential_definition = CreateCredentialDefinition(
            schema_id=schema_definition.id,
            tag=random_string(5),
            support_revocation=support_revocation,
        )
    
        auth = acapy_auth_verified(
            acapy_auth_from_header(faber_client.headers["x-api-key"])
        )
    
        result = (
>           await definitions.create_credential_definition(
                credential_definition=credential_definition, auth=auth
            )
        ).model_dump()

app/tests/e2e/test_definitions.py:175: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fbcc2b53bc0>
credential_definition_id = '3DXDamaSyLDymwdfc7gVUA:3:CL:3308:DKNIL'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 89 in app/tests/e2e/test_did_exchange.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_did_exchange.test_create_did_exchange_request[clean-clean-True-None-False]

app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c41bb770>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c41c4a40>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c41bab10>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c41bbfe0>
use_did = True, use_did_method = None, use_public_did = False

    @pytest.mark.anyio
    @pytest.mark.parametrize(
        "use_did,use_did_method,use_public_did",
        [
            (None, None, False),
            (True, None, False),
            (None, "did:peer:2", False),
            (None, "did:peer:4", False),
            (True, "did:peer:4", False),
            (None, None, True),
        ],
    )
    async def test_create_did_exchange_request(
        alice_member_client: RichAsyncClient,
        faber_client: RichAsyncClient,
        alice_acapy_client: AcaPyClient,
        faber_acapy_client: AcaPyClient,
        use_did: Optional[str],
        use_did_method: Optional[str],
        use_public_did: bool,
    ):
        faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
    
        request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
    
        if use_did:
            new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
            request_data["use_did"] = new_did.did
    
        if use_did_method:
            request_data["use_did_method"] = use_did_method
    
        if use_public_did:
            request_data["use_public_did"] = use_public_did
    
        if use_public_did:  # Alice doesn't have a public DID
            with pytest.raises(HTTPException) as exc_info:
                response = await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
    
        elif use_did and use_did_method:
            with pytest.raises(HTTPException) as exc_info:
                await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert (
                exc_info.value.detail
                == """{"detail":"Cannot specify both use_did and use_did_method."}"""
            )
        else:
            response = await alice_member_client.post(
                f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
            )
            assert response.status_code == 200
            connection_record = response.json()
            assert_that(connection_record).contains("connection_id", "state")
            assert_that(connection_record["state"]).is_equal_to("request-sent")
    
            alice_connection_id = connection_record["connection_id"]
            alice_did = connection_record["my_did"]
    
            try:
                # Due to auto-accepts, Alice's connection is complete
>               assert await check_webhook_state(
                    alice_member_client,
                    topic="connections",
                    state="completed",
                    filter_map={"connection_id": alice_connection_id},
                )

app/tests/e2e/test_did_exchange.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:58: in check_webhook_state
    event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.tests.util.sse_listener.SseListener object at 0x7f60c41e88c0>
field = 'connection_id', field_id = '9cb14583-aebc-4f80-b6ca-7fc2dd3fbff8'
desired_state = 'completed', timeout = Timeout(timeout=30)

    async def wait_for_event(
        self,
        field,
        field_id,
        desired_state,
        timeout: int = DEFAULT_LISTENER_TIMEOUT,
    ) -> Dict[str, Any]:
        """
        Start listening for SSE events. When an event is received that matches the specified parameters.
        """
        url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}?look_back=5"
    
        timeout = Timeout(timeout)
        async with RichAsyncClient(timeout=timeout) as client:
            async with client.stream("GET", url) as response:
                async for line in response.aiter_lines():
                    if line.startswith("data: "):
                        data = json.loads(line[6:])
                        return data["payload"]
                    elif line == "" or line.startswith(": ping"):
                        pass  # ignore newlines and pings
                    else:
                        logger.warning("Unexpected SSE line: {}", line)
    
>       raise SseListenerTimeout("Requested filtered event was not returned by server.")
E       app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.

app/tests/util/sse_listener.py:56: SseListenerTimeout

Check failure on line 89 in app/tests/e2e/test_did_exchange.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_did_exchange.test_create_did_exchange_request[clean-clean-None-did:peer:2-False]

app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c55b45f0>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c41c4a40>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c55b7860>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c55b7a70>
use_did = None, use_did_method = 'did:peer:2', use_public_did = False

    @pytest.mark.anyio
    @pytest.mark.parametrize(
        "use_did,use_did_method,use_public_did",
        [
            (None, None, False),
            (True, None, False),
            (None, "did:peer:2", False),
            (None, "did:peer:4", False),
            (True, "did:peer:4", False),
            (None, None, True),
        ],
    )
    async def test_create_did_exchange_request(
        alice_member_client: RichAsyncClient,
        faber_client: RichAsyncClient,
        alice_acapy_client: AcaPyClient,
        faber_acapy_client: AcaPyClient,
        use_did: Optional[str],
        use_did_method: Optional[str],
        use_public_did: bool,
    ):
        faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
    
        request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
    
        if use_did:
            new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
            request_data["use_did"] = new_did.did
    
        if use_did_method:
            request_data["use_did_method"] = use_did_method
    
        if use_public_did:
            request_data["use_public_did"] = use_public_did
    
        if use_public_did:  # Alice doesn't have a public DID
            with pytest.raises(HTTPException) as exc_info:
                response = await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
    
        elif use_did and use_did_method:
            with pytest.raises(HTTPException) as exc_info:
                await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert (
                exc_info.value.detail
                == """{"detail":"Cannot specify both use_did and use_did_method."}"""
            )
        else:
            response = await alice_member_client.post(
                f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
            )
            assert response.status_code == 200
            connection_record = response.json()
            assert_that(connection_record).contains("connection_id", "state")
            assert_that(connection_record["state"]).is_equal_to("request-sent")
    
            alice_connection_id = connection_record["connection_id"]
            alice_did = connection_record["my_did"]
    
            try:
                # Due to auto-accepts, Alice's connection is complete
>               assert await check_webhook_state(
                    alice_member_client,
                    topic="connections",
                    state="completed",
                    filter_map={"connection_id": alice_connection_id},
                )

app/tests/e2e/test_did_exchange.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:58: in check_webhook_state
    event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.tests.util.sse_listener.SseListener object at 0x7f60c55b4e00>
field = 'connection_id', field_id = '500de198-03e1-457a-9f77-ce2003b44d0d'
desired_state = 'completed', timeout = Timeout(timeout=30)

    async def wait_for_event(
        self,
        field,
        field_id,
        desired_state,
        timeout: int = DEFAULT_LISTENER_TIMEOUT,
    ) -> Dict[str, Any]:
        """
        Start listening for SSE events. When an event is received that matches the specified parameters.
        """
        url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}?look_back=5"
    
        timeout = Timeout(timeout)
        async with RichAsyncClient(timeout=timeout) as client:
            async with client.stream("GET", url) as response:
                async for line in response.aiter_lines():
                    if line.startswith("data: "):
                        data = json.loads(line[6:])
                        return data["payload"]
                    elif line == "" or line.startswith(": ping"):
                        pass  # ignore newlines and pings
                    else:
                        logger.warning("Unexpected SSE line: {}", line)
    
>       raise SseListenerTimeout("Requested filtered event was not returned by server.")
E       app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.

app/tests/util/sse_listener.py:56: SseListenerTimeout

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_clear_pending_revokes[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_clear_pending_revokes_no_map[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_publish_all_revocations_for_rev_reg_id[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_publish_all_revocations_no_payload[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_publish_one_revocation[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/test_revocation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_revocation.test_get_pending_revocations[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fe32e986b20>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:490: in wait_for_active_registry
    active_registries = await get_created_active_registries(controller, cred_def_id)
app/services/revocation_registry.py:466: in get_created_active_registries
    reg = await handle_acapy_call(
app/exceptions/handle_acapy_call.py:42: in handle_acapy_call
    return await acapy_call(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/pydantic/_internal/_validate_call.py:33: in wrapper_function
    return await wrapper(*args, **kwargs)
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api/revocation_api.py:636: in get_created_registries
    response_data = await self.api_client.call_api(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/api_client.py:254: in call_api
    response_data = await self.rest_client.request(
/usr/local/lib/python3.12/site-packages/aries_cloudcontroller/rest.py:195: in request
    r = await pool_manager.request(**args)
/usr/local/lib/python3.12/site-packages/aiohttp/client.py:728: in _request
    await resp.start(conn)
/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py:1055: in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <aiohttp.client_proto.ResponseHandler object at 0x7fe32ed27950>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
>               await self._waiter
E               asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/site-packages/aiohttp/streams.py:668: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fe32f9e8cc0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_clear_pending_revokes[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fe32e9c6600>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:84.58.69', name='test_schema_alt', version='84.58.69', attribute_names=['age', 'speed', 'name'])}
local_func = <function credential_definition_id_revocable at 0x7fe332c613a0>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fe32e9a5dc0>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fe32e9c4650>
credential_definition_id = 'WS6QNG2JGhHZAhCEwXa123:3:CL:3347:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/verifier/test_proof_revoked_credential.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_proof_revoked_credential.test_proof_revoked_credential[clean-clean-clean-clean-clean-clean-auto_publish_true]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7f6fa9575460>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:489: in wait_for_active_registry
    await asyncio.sleep(sleep_duration)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.5, result = None

    async def sleep(delay, result=None):
        """Coroutine that completes after a given time (in seconds)."""
        if delay <= 0:
            await __sleep0()
            return result
    
        loop = events.get_running_loop()
        future = loop.create_future()
        h = loop.call_later(delay,
                            futures._set_result_unless_cancelled,
                            future, result)
        try:
>           return await future
E           asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/asyncio/tasks.py:665: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7f6faafa5dc0>
credential_definition_id = 'GcE8FxGB7YS7WAzrxyDLHK:3:CL:3360:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7f6fa959fb40>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_proof_revoked_credential[clean-clean-clean-clean-clean-clean-auto_publish_true]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7f6faaf40590>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:55.97.13', name='test_schema_alt', version='55.97.13', attribute_names=['name', 'speed', 'age'])}
local_func = <function credential_definition_id_revocable at 0x7f6faee6d300>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7f6faab0a180>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7f6faafa5dc0>
credential_definition_id = 'GcE8FxGB7YS7WAzrxyDLHK:3:CL:3360:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/verifier/test_proof_revoked_credential.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_proof_revoked_credential.test_proof_revoked_credential[clean-clean-clean-clean-clean-clean-default]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7f6fa9575460>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:489: in wait_for_active_registry
    await asyncio.sleep(sleep_duration)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.5, result = None

    async def sleep(delay, result=None):
        """Coroutine that completes after a given time (in seconds)."""
        if delay <= 0:
            await __sleep0()
            return result
    
        loop = events.get_running_loop()
        future = loop.create_future()
        h = loop.call_later(delay,
                            futures._set_result_unless_cancelled,
                            future, result)
        try:
>           return await future
E           asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/asyncio/tasks.py:665: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7f6faafa5dc0>
credential_definition_id = 'GcE8FxGB7YS7WAzrxyDLHK:3:CL:3360:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7f6fa959fb40>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_proof_revoked_credential[clean-clean-clean-clean-clean-clean-auto_publish_true]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7f6faaf40590>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:55.97.13', name='test_schema_alt', version='55.97.13', attribute_names=['name', 'speed', 'age'])}
local_func = <function credential_definition_id_revocable at 0x7f6faee6d300>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7f6faab0a180>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7f6faafa5dc0>
credential_definition_id = 'GcE8FxGB7YS7WAzrxyDLHK:3:CL:3360:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 1 in app/tests/e2e/issuer/test_indy_credentials.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_indy_credentials.test_revoke_credential[clean-clean-clean-clean-clean]

failed on setup with "app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation."
Raw output
fut = <coroutine object wait_for_active_registry at 0x7fb7233a73e0>
timeout = 120

    async def wait_for(fut, timeout):
        """Wait for the single Future or coroutine to complete, with timeout.
    
        Coroutine will be wrapped in Task.
    
        Returns result of the Future or coroutine.  When a timeout occurs,
        it cancels the task and raises TimeoutError.  To avoid the task
        cancellation, wrap it in shield().
    
        If the wait is cancelled, the task is also cancelled.
    
        If the task suppresses the cancellation and returns a value instead,
        that value is returned.
    
        This function is a coroutine.
        """
        # The special case for timeout <= 0 is for the following case:
        #
        # async def test_waitfor():
        #     func_started = False
        #
        #     async def func():
        #         nonlocal func_started
        #         func_started = True
        #
        #     try:
        #         await asyncio.wait_for(func(), 0)
        #     except asyncio.TimeoutError:
        #         assert not func_started
        #     else:
        #         assert False
        #
        # asyncio.run(test_waitfor())
    
    
        if timeout is not None and timeout <= 0:
            fut = ensure_future(fut)
    
            if fut.done():
                return fut.result()
    
            await _cancel_and_wait(fut)
            try:
                return fut.result()
            except exceptions.CancelledError as exc:
                raise TimeoutError from exc
    
        async with timeouts.timeout(timeout):
>           return await fut

/usr/local/lib/python3.12/asyncio/tasks.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/services/revocation_registry.py:489: in wait_for_active_registry
    await asyncio.sleep(sleep_duration)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.5, result = None

    async def sleep(delay, result=None):
        """Coroutine that completes after a given time (in seconds)."""
        if delay <= 0:
            await __sleep0()
            return result
    
        loop = events.get_running_loop()
        future = loop.create_future()
        h = loop.call_later(delay,
                            futures._set_result_unless_cancelled,
                            future, result)
        try:
>           return await future
E           asyncio.exceptions.CancelledError

/usr/local/lib/python3.12/asyncio/tasks.py:665: CancelledError

The above exception was the direct cause of the following exception:

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fb7233e4980>
credential_definition_id = 'A6eV74i5snqnSEYR8dckrA:3:CL:3367:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
>           await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )

app/services/definitions/credential_definition_publisher.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/asyncio/tasks.py:519: in wait_for
    async with timeouts.timeout(timeout):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Timeout [expired]>
exc_type = <class 'asyncio.exceptions.CancelledError'>
exc_val = CancelledError(), exc_tb = <traceback object at 0x7fb723b883c0>

    async def __aexit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        exc_tb: Optional[TracebackType],
    ) -> Optional[bool]:
        assert self._state in (_State.ENTERED, _State.EXPIRING)
    
        if self._timeout_handler is not None:
            self._timeout_handler.cancel()
            self._timeout_handler = None
    
        if self._state is _State.EXPIRING:
            self._state = _State.EXPIRED
    
            if self._task.uncancel() <= self._cancelling and exc_type is exceptions.CancelledError:
                # Since there are no new cancel requests, we're
                # handling this.
>               raise TimeoutError from exc_val
E               TimeoutError

/usr/local/lib/python3.12/asyncio/timeouts.py:115: TimeoutError

The above exception was the direct cause of the following exception:

anyio_backend = 'asyncio'
request = <SubRequest 'credential_definition_id_revocable' for <Function test_revoke_credential[clean-clean-clean-clean-clean]>>
args = ()
kwargs = {'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fb723fa7c20>, 'request': <SubRequest 'cre...JJm:2:test_schema_alt:53.10.66', name='test_schema_alt', version='53.10.66', attribute_names=['name', 'speed', 'age'])}
local_func = <function credential_definition_id_revocable at 0x7fb7278a4040>
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fb7233e3a40>

    def wrapper(
        *args: Any, anyio_backend: Any, request: SubRequest, **kwargs: Any
    ) -> Any:
        # Rebind any fixture methods to the request instance
        if (
            request.instance
            and ismethod(func)
            and type(func.__self__) is type(request.instance)
        ):
            local_func = func.__func__.__get__(request.instance)
        else:
            local_func = func
    
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        if has_request_arg:
            kwargs["request"] = request
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(local_func):
                yield from runner.run_asyncgen_fixture(local_func, kwargs)
            else:
>               yield runner.run_fixture(local_func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2300: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:686: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2270: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:2237: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/definitions.py:177: in credential_definition_id_revocable
    result = await get_clean_or_regression_test_cred_def(
app/tests/fixtures/definitions.py:139: in get_clean_or_regression_test_cred_def
    result = await create_credential_definition(
app/routes/definitions.py:255: in create_credential_definition
    credential_definition_id = await cred_def_service.create_credential_definition(
app/services/definitions/credential_definitions.py:65: in create_credential_definition
    await publisher.wait_for_revocation_registry(credential_definition_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.services.definitions.credential_definition_publisher.CredentialDefinitionPublisher object at 0x7fb7233e4980>
credential_definition_id = 'A6eV74i5snqnSEYR8dckrA:3:CL:3367:tag'

    async def wait_for_revocation_registry(self, credential_definition_id):
        try:
            self._logger.debug("Waiting for revocation registry creation")
            await asyncio.wait_for(
                wait_for_active_registry(self._controller, credential_definition_id),
                timeout=REGISTRY_CREATION_TIMEOUT,
            )
        except asyncio.TimeoutError as e:
            self._logger.error("Timeout waiting for revocation registry creation.")
>           raise CloudApiException(
                "Timeout waiting for revocation registry creation.",
                504,
            ) from e
E           app.exceptions.cloudapi_exception.CloudApiException: 504: Timeout waiting for revocation registry creation.

app/services/definitions/credential_definition_publisher.py:71: CloudApiException

Check failure on line 89 in app/tests/e2e/test_did_exchange.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_did_exchange.test_create_did_exchange_request[clean-clean-None-did:peer:4-False]

app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c515ff80>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7f60c41c4a40>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c515cbc0>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7f60c515d3d0>
use_did = None, use_did_method = 'did:peer:4', use_public_did = False

    @pytest.mark.anyio
    @pytest.mark.parametrize(
        "use_did,use_did_method,use_public_did",
        [
            (None, None, False),
            (True, None, False),
            (None, "did:peer:2", False),
            (None, "did:peer:4", False),
            (True, "did:peer:4", False),
            (None, None, True),
        ],
    )
    async def test_create_did_exchange_request(
        alice_member_client: RichAsyncClient,
        faber_client: RichAsyncClient,
        alice_acapy_client: AcaPyClient,
        faber_acapy_client: AcaPyClient,
        use_did: Optional[str],
        use_did_method: Optional[str],
        use_public_did: bool,
    ):
        faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
    
        request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
    
        if use_did:
            new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
            request_data["use_did"] = new_did.did
    
        if use_did_method:
            request_data["use_did_method"] = use_did_method
    
        if use_public_did:
            request_data["use_public_did"] = use_public_did
    
        if use_public_did:  # Alice doesn't have a public DID
            with pytest.raises(HTTPException) as exc_info:
                response = await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
    
        elif use_did and use_did_method:
            with pytest.raises(HTTPException) as exc_info:
                await alice_member_client.post(
                    f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
                    params=request_data,
                )
            assert exc_info.value.status_code == 400
            assert (
                exc_info.value.detail
                == """{"detail":"Cannot specify both use_did and use_did_method."}"""
            )
        else:
            response = await alice_member_client.post(
                f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
            )
            assert response.status_code == 200
            connection_record = response.json()
            assert_that(connection_record).contains("connection_id", "state")
            assert_that(connection_record["state"]).is_equal_to("request-sent")
    
            alice_connection_id = connection_record["connection_id"]
            alice_did = connection_record["my_did"]
    
            try:
                # Due to auto-accepts, Alice's connection is complete
>               assert await check_webhook_state(
                    alice_member_client,
                    topic="connections",
                    state="completed",
                    filter_map={"connection_id": alice_connection_id},
                )

app/tests/e2e/test_did_exchange.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:58: in check_webhook_state
    event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <app.tests.util.sse_listener.SseListener object at 0x7f60c515f410>
field = 'connection_id', field_id = 'b72f19e3-dfe9-4838-92ca-fbc250412b62'
desired_state = 'completed', timeout = Timeout(timeout=30)

    async def wait_for_event(
        self,
        field,
        field_id,
        desired_state,
        timeout: int = DEFAULT_LISTENER_TIMEOUT,
    ) -> Dict[str, Any]:
        """
        Start listening for SSE events. When an event is received that matches the specified parameters.
        """
        url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}?look_back=5"
    
        timeout = Timeout(timeout)
        async with RichAsyncClient(timeout=timeout) as client:
            async with client.stream("GET", url) as response:
                async for line in response.aiter_lines():
                    if line.startswith("data: "):
                        data = json.loads(line[6:])
                        return data["payload"]
                    elif line == "" or line.startswith(": ping"):
                        pass  # ignore newlines and pings
                    else:
                        logger.warning("Unexpected SSE line: {}", line)
    
>       raise SseListenerTimeout("Requested filtered event was not returned by server.")
E       app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.

app/tests/util/sse_listener.py:56: SseListenerTimeout