Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ ✨ Upgrade acapy 1.0.0 #990

Merged
merged 70 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
68ce378
:arrow_up: Upgrade to ACA-Py 1.0.0rc5
ff137 Jul 24, 2024
4e77cda
update to new packages
cl0ete Aug 8, 2024
1f244ef
aca-py updated wallet type using wallet type
cl0ete Aug 8, 2024
8d312e4
pointing to test branch
cl0ete Aug 8, 2024
1d2489f
update agent and plugin versions
cl0ete Aug 19, 2024
d6bdef6
update cloudcontroller version
cl0ete Aug 19, 2024
dacc93e
update lock files
cl0ete Aug 19, 2024
f8c7a97
update version
cl0ete Aug 19, 2024
37ae88e
update lock file
cl0ete Aug 19, 2024
2d886e5
update agent version
cl0ete Aug 19, 2024
7fd7639
add revoked response model
cl0ete Jul 16, 2024
2b2ade1
import model
cl0ete Jul 16, 2024
b0e83cc
update response model and status code
cl0ete Jul 16, 2024
369f09c
update docstring with new return model
cl0ete Jul 16, 2024
11efbcc
return revoked response
cl0ete Jul 16, 2024
229cbe6
update response type and status code
cl0ete Jul 16, 2024
6b10bac
update response model description in docstrings
cl0ete Jul 16, 2024
2b9085d
if no result no revocation to publish
cl0ete Jul 16, 2024
108d197
get transaction id from result
cl0ete Jul 16, 2024
1b0f224
return revoked response
cl0ete Jul 16, 2024
4c7a61f
import new models needed
cl0ete Jul 16, 2024
2f4288b
update return type
cl0ete Jul 16, 2024
8e29dcf
if credential is published return revoked cred_rev_ids
cl0ete Jul 16, 2024
61186cf
return empty revokedResponse if no creds revoked
cl0ete Jul 16, 2024
af68326
update return type
cl0ete Jul 16, 2024
a0727a9
import sort
cl0ete Jul 16, 2024
c48a306
formatting
cl0ete Jul 16, 2024
ca1baed
fix unit tests
cl0ete Jul 16, 2024
53e1d47
import sort/formatting
cl0ete Jul 16, 2024
085d559
get cred_rev_id and clear that id
cl0ete Jul 17, 2024
b0ea761
assert revoked with id in list
cl0ete Jul 17, 2024
dc95f22
update cred_rev_id
cl0ete Jul 17, 2024
ac4785a
update revoked response model
cl0ete Jul 17, 2024
74b79cf
use model_validate to build RevokedResponse
cl0ete Jul 17, 2024
6abc911
add get pending revocation route
cl0ete Jul 17, 2024
bf839bb
add import root_validator
cl0ete Jul 17, 2024
5c1e9de
add pending revocation model
cl0ete Jul 17, 2024
e58d51e
import pending revocation model
cl0ete Jul 17, 2024
df44008
update how data is passed to revokedResponse
cl0ete Jul 17, 2024
ca86717
add function to get pending revocations
cl0ete Jul 17, 2024
8ebe90f
update docstrings and simplify route
cl0ete Jul 18, 2024
b5712ea
make class verbose and shorten strings
cl0ete Jul 18, 2024
2ef35f9
use pydantic v2 validator
cl0ete Jul 18, 2024
9b675d5
add id to route
cl0ete Jul 18, 2024
aee541b
add e2e test for get pending revocations for rev_reg_id
cl0ete Jul 18, 2024
de8e0fd
fix tests
cl0ete Jul 18, 2024
8deb360
comment
cl0ete Jul 18, 2024
bc72ea2
formatting
cl0ete Jul 18, 2024
e2064b5
add classmethod decorator
cl0ete Jul 30, 2024
0fd6d36
add unittests for get pending revocations
cl0ete Jul 30, 2024
8715e5c
add unit tests for get pending revocations service
cl0ete Jul 30, 2024
8f62f12
formatting
cl0ete Jul 30, 2024
4e95582
remove unused import
cl0ete Jul 30, 2024
ba5be90
move dummy txn record to utils
cl0ete Jul 31, 2024
56788bf
remove unused variable
cl0ete Jul 31, 2024
55401c1
add dummy txn record to utils
cl0ete Jul 31, 2024
0d8e958
import Any from typing
cl0ete Aug 13, 2024
dce8564
update RevokedResponse model to work with new response from agent
cl0ete Aug 13, 2024
9ac9488
get first transaction_id from response and wait for transaction_acked
cl0ete Aug 13, 2024
4c8511e
get transaction_id from response that is list now
cl0ete Aug 13, 2024
fc169a3
fix tests
cl0ete Aug 19, 2024
5e19c4c
tweak RevokedResponse model added some types to validator
cl0ete Aug 19, 2024
6ff7db8
pass result in correct format to model
cl0ete Aug 19, 2024
c58ed3b
:art:
cl0ete Aug 19, 2024
68c0ddc
make sure object not empty
cl0ete Aug 20, 2024
ea7228e
:art:
cl0ete Aug 20, 2024
ca5b73a
if revoked called on ex_id the second time raise exception
cl0ete Aug 20, 2024
c2503cc
:art:
cl0ete Aug 20, 2024
615d380
:arrow_up: use latest acapy-plugins release
ff137 Aug 20, 2024
c90355c
:bug: adjust look_back duration correctly by setting max value
ff137 Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ repos:
hooks:
- id: isort
stages: [push]
args: ["--profile", "black"]
args: ["--profile", "black", "."]
46 changes: 43 additions & 3 deletions app/models/issuer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from enum import Enum
from typing import Dict, List, Optional
from typing import Any, Dict, List, Optional

from aries_cloudcontroller import LDProofVCDetail
from pydantic import BaseModel, Field, ValidationInfo, field_validator
from aries_cloudcontroller import (
LDProofVCDetail,
TransactionRecord,
TxnOrPublishRevocationsResult,
)
from pydantic import BaseModel, Field, ValidationInfo, field_validator, model_validator

from shared.exceptions import CloudApiValueError
from shared.models.protocol import IssueCredentialProtocolVersion
Expand Down Expand Up @@ -98,3 +102,39 @@ class ClearPendingRevocationsResult(BaseModel):
"The resulting revocations that are still pending after a clear-pending request has been completed."
),
)


class RevokedResponse(BaseModel):
cred_rev_ids_published: Dict[str, List[int]] = Field(
default_factory=dict,
description=(
"A map of revocation registry IDs to lists of credential revocation IDs "
"(as integers) that have been revoked. Can be empty."
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
),
)

@model_validator(mode="before")
@classmethod
def extract_revoked_info(
cls, values: TxnOrPublishRevocationsResult
) -> Dict[str, Any]:
if isinstance(values, dict) and "txn" in values:
txn_list: List[TransactionRecord] = values.get("txn")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor note: this isn't actually a List[TransactionRecord]. It's a List[Dict[str,Any]], which has same shape as List[TransactionRecord]. Point being that the pydantic model doesn't have a .get method. So the type hint makes it seem like txn.get will error. So, for clarity we can just set the type hint to list of dict, and comment that it's list transactionrecord

cred_rev_ids_published = {}

for txn in txn_list:
for attach in txn.get("messages_attach", []):
data = attach.get("data", {}).get("json", {})
operation = data.get("operation", {})
revoc_reg_def_id = operation.get("revocRegDefId")
revoked = operation.get("value", {}).get("revoked", [])
if revoc_reg_def_id and revoked:
cred_rev_ids_published[revoc_reg_def_id] = revoked

values["cred_rev_ids_published"] = cred_rev_ids_published

return values


class PendingRevocations(BaseModel):
pending_cred_rev_ids: list[Optional[int]] = []
168 changes: 84 additions & 84 deletions app/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package-mode = false
python = "^3.12"

aiohttp = "~3.10.3"
aries-cloudcontroller = "==1.0.0rc4"
aries-cloudcontroller = "==1.0.0"
base58 = "~2.1.1"
fastapi = "~0.112.0"
fastapi_websocket_pubsub = "~0.3.8"
Expand Down
73 changes: 61 additions & 12 deletions app/routes/issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
ClearPendingRevocationsResult,
CreateOffer,
CredentialType,
PendingRevocations,
PublishRevocationsRequest,
RevokeCredential,
RevokedResponse,
SendCredential,
)
from app.services import revocation_registry
Expand Down Expand Up @@ -497,11 +499,11 @@ async def remove_credential_exchange_record(
bound_logger.debug("Successfully deleted credential exchange record.")


@router.post("/revoke", summary="Revoke a Credential (if revocable)", status_code=204)
@router.post("/revoke", summary="Revoke a Credential (if revocable)")
async def revoke_credential(
body: RevokeCredential,
auth: AcaPyAuth = Depends(acapy_auth_from_header),
) -> None:
) -> RevokedResponse:
"""
Revoke a credential
---
Expand All @@ -523,20 +525,24 @@ async def revoke_credential(

Returns:
---
status_code: 204
RevokedResponse:
revoked_cred_rev_ids:
The revocation registry indexes that were revoked.
Will be empty if the revocation was marked as pending.
"""
bound_logger = logger.bind(body=body)
bound_logger.debug("POST request received: Revoke credential")

async with client_from_auth(auth) as aries_controller:
bound_logger.debug("Revoking credential")
await revocation_registry.revoke_credential(
result = await revocation_registry.revoke_credential(
controller=aries_controller,
credential_exchange_id=body.credential_exchange_id,
auto_publish_to_ledger=body.auto_publish_on_ledger,
)

bound_logger.debug("Successfully revoked credential.")
bound_logger.info("Successfully revoked credential.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return result


@router.get(
Expand Down Expand Up @@ -609,13 +615,11 @@ async def get_credential_revocation_record(
return revocation_record


@router.post(
"/publish-revocations", summary="Publish Pending Revocations", status_code=204
)
@router.post("/publish-revocations", summary="Publish Pending Revocations")
async def publish_revocations(
publish_request: PublishRevocationsRequest,
auth: AcaPyAuth = Depends(acapy_auth_from_header),
) -> None:
) -> RevokedResponse:
"""
Write pending revocations to the ledger
---
Expand Down Expand Up @@ -647,18 +651,26 @@ async def publish_revocations(

Returns:
---
status_code: 204
RevokedResponse:
revoked_cred_rev_ids:
The revocation registry indexes that were revoked.
Will be empty if there were no revocations to publish.
"""
bound_logger = logger.bind(body=publish_request)
bound_logger.debug("POST request received: Publish revocations")

async with client_from_auth(auth) as aries_controller:
bound_logger.debug("Publishing revocations")
endorser_transaction_id = await revocation_registry.publish_pending_revocations(
result = await revocation_registry.publish_pending_revocations(
controller=aries_controller,
revocation_registry_credential_map=publish_request.revocation_registry_credential_map,
)

if not result:
bound_logger.debug("No revocations to publish.")
return RevokedResponse()

endorser_transaction_id = result.txn[0].transaction_id
if endorser_transaction_id:
bound_logger.debug(
"Wait for publish complete on transaction id: {}",
Expand All @@ -681,7 +693,8 @@ async def publish_revocations(
504,
) from e

bound_logger.debug("Successfully published revocations.")
bound_logger.info("Successfully published revocations.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return RevokedResponse.model_validate(result.model_dump())


@router.post(
Expand Down Expand Up @@ -739,3 +752,39 @@ async def clear_pending_revocations(

bound_logger.debug("Successfully cleared pending revocations.")
return response


@router.get(
"/get-pending-revocations/{revocation_registry_id}",
summary="Get Pending Revocations",
)
async def get_pending_revocations(
revocation_registry_id: str,
auth: AcaPyAuth = Depends(acapy_auth_from_header),
) -> PendingRevocations:
"""
Get pending revocations
---
Get the pending revocations for a given revocation registry ID.

Parameters:
---
revocation_registry_id: str
The ID of the revocation registry for which to fetch pending revocations

Returns:
---
PendingRevocations:
A list of cred_rev_ids pending revocation for a given revocation registry ID
"""
bound_logger = logger.bind(body={"revocation_registry_id": revocation_registry_id})
bound_logger.info("GET request received: Get pending revocations")

async with client_from_auth(auth) as aries_controller:
bound_logger.debug("Getting pending revocations")
result = await revocation_registry.get_pending_revocations(
controller=aries_controller, rev_reg_id=revocation_registry_id
)

bound_logger.info("Successfully fetched pending revocations.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return PendingRevocations(pending_cred_rev_ids=result)
69 changes: 60 additions & 9 deletions app/services/revocation_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
PublishRevocations,
RevokeRequest,
RevRegResult,
TxnOrPublishRevocationsResult,
)

from app.exceptions import (
CloudApiException,
handle_acapy_call,
handle_model_with_validation,
)
from app.models.issuer import ClearPendingRevocationsResult
from app.models.issuer import ClearPendingRevocationsResult, RevokedResponse
from app.util.credentials import strip_protocol_prefix
from app.util.retry_method import coroutine_with_retry
from shared.log_config import get_logger
Expand Down Expand Up @@ -72,7 +73,7 @@ async def revoke_credential(
controller: AcaPyClient,
credential_exchange_id: str,
auto_publish_to_ledger: bool = False,
) -> None:
) -> RevokedResponse:
"""
Revoke an issued credential

Expand Down Expand Up @@ -103,7 +104,7 @@ async def revoke_credential(
publish=auto_publish_to_ledger,
)
try:
await handle_acapy_call(
revoke_result = await handle_acapy_call(
logger=bound_logger,
acapy_call=controller.revocation.revoke_credential,
body=request_body,
Expand Down Expand Up @@ -144,12 +145,27 @@ async def revoke_credential(
"Please check the revocation record state and retry if not revoked."
)

bound_logger.debug("Successfully revoked credential.")
if not revoke_result:
raise CloudApiException(
"Revocation was published but no result was returned. "
"Has this credential been revoked before?"
)

if (
revoke_result
and revoke_result["txn"]
and revoke_result["txn"]["messages_attach"][0]
):
bound_logger.info("Successfully revoked credential.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return RevokedResponse.model_validate({"txn": [revoke_result["txn"]]})

bound_logger.info("Successfully revoked credential.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return RevokedResponse()


async def publish_pending_revocations(
controller: AcaPyClient, revocation_registry_credential_map: Dict[str, List[str]]
) -> Optional[str]:
) -> TxnOrPublishRevocationsResult:
"""
Publish pending revocations

Expand Down Expand Up @@ -181,19 +197,19 @@ async def publish_pending_revocations(
f"Failed to publish pending revocations: {e.detail}", e.status_code
) from e

if not result.txn or not result.txn.transaction_id:
if not result.txn or not result.txn[0].transaction_id:
bound_logger.warning(
"Published pending revocations but received no endorser transaction id. Got result: {}",
result,
)
return

endorse_transaction_id = result.txn.transaction_id
bound_logger.debug(
endorse_transaction_id = result.txn[0].transaction_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ... looks like we need to now endorse a potential list of transaction ids? Here we're just taking the first one

bound_logger.info(
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
"Successfully published pending revocations. Endorser transaction id: {}.",
endorse_transaction_id,
)
return endorse_transaction_id
return result


async def clear_pending_revocations(
Expand Down Expand Up @@ -487,3 +503,38 @@ async def wait_for_active_registry(
sleep_duration = 0.5 # Following sleeps should wait 0.5s before retry

return active_registries


async def get_pending_revocations(
controller: AcaPyClient, rev_reg_id: str
) -> List[int]:
"""
Get the pending revocations for a revocation registry.

Args:
controller (AcaPyClient): aca-py client
rev_reg_id (str): The revocation registry ID.

Raises:
Exception: When the pending revocations could not be retrieved.

Returns:
pending_revocations (List[str]): The pending revocations.
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
"""
bound_logger = logger.bind(body={"rev_reg_id": rev_reg_id})
bound_logger.info("Fetching pending revocations for a revocation registry")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved

try:
result = await handle_acapy_call(
logger=bound_logger,
acapy_call=controller.revocation.get_registry,
rev_reg_id=rev_reg_id,
)
except CloudApiException as e:
raise CloudApiException(
f"Failed to get pending revocations: {e.detail}", e.status_code
) from e

pending_revocations = result.result.pending_pub
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
bound_logger.info("Successfully retrieved pending revocations.")
cl0ete marked this conversation as resolved.
Show resolved Hide resolved
return pending_revocations
5 changes: 3 additions & 2 deletions app/tests/e2e/issuer/test_indy_credentials.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import asyncio

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential[clean-clean-clean-clean-clean-v1]

failed on setup with "httpx.ConnectError: All connection attempts failed"
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

anyio_backend = 'asyncio', args = ()
kwargs = {'alice_member_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced234a2a0>, 'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>, 'test_mode': 'clean'}
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fced1fe74d0>

    def wrapper(*args, anyio_backend, **kwargs):  # type: ignore[no-untyped-def]
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(func):
                yield from runner.run_asyncgen_fixture(func, kwargs)
            else:
>               yield runner.run_fixture(func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1987: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:687: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1957: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1932: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/member_connections.py:46: in faber_and_alice_connection
    bob_alice_connection = await create_connection_by_test_mode(
app/tests/util/connections.py:169: in create_connection_by_test_mode
    return await create_bob_alice_connection(
app/tests/util/connections.py:90: in create_bob_alice_connection
    await assert_both_connections_ready(
app/tests/util/connections.py:53: in assert_both_connections_ready
    await assert_both_webhooks_received(
app/tests/util/webhooks.py:132: in assert_both_webhooks_received
    results = await asyncio.gather(
app/tests/util/webhooks.py:128: in check_webhook
    return await check_webhook_state(
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential[clean-clean-clean-clean-clean-v2]

failed on setup with "httpx.ConnectError: All connection attempts failed"
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

anyio_backend = 'asyncio', args = ()
kwargs = {'alice_member_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced2345640>, 'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>, 'test_mode': 'clean'}
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fced1fe74d0>

    def wrapper(*args, anyio_backend, **kwargs):  # type: ignore[no-untyped-def]
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(func):
                yield from runner.run_asyncgen_fixture(func, kwargs)
            else:
>               yield runner.run_fixture(func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1987: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:687: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1957: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1932: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/member_connections.py:46: in faber_and_alice_connection
    bob_alice_connection = await create_connection_by_test_mode(
app/tests/util/connections.py:169: in create_connection_by_test_mode
    return await create_bob_alice_connection(
app/tests/util/connections.py:90: in create_bob_alice_connection
    await assert_both_connections_ready(
app/tests/util/connections.py:53: in assert_both_connections_ready
    await assert_both_webhooks_received(
app/tests/util/webhooks.py:132: in assert_both_webhooks_received
    results = await asyncio.gather(
app/tests/util/webhooks.py:128: in check_webhook
    return await check_webhook_state(
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential_request[clean-clean-clean-clean-clean-v1]

failed on setup with "httpx.ConnectError: All connection attempts failed"
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

anyio_backend = 'asyncio', args = ()
kwargs = {'alice_member_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced23448f0>, 'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>, 'test_mode': 'clean'}
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fced1fe74d0>

    def wrapper(*args, anyio_backend, **kwargs):  # type: ignore[no-untyped-def]
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(func):
                yield from runner.run_asyncgen_fixture(func, kwargs)
            else:
>               yield runner.run_fixture(func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1987: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:687: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1957: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1932: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/member_connections.py:46: in faber_and_alice_connection
    bob_alice_connection = await create_connection_by_test_mode(
app/tests/util/connections.py:169: in create_connection_by_test_mode
    return await create_bob_alice_connection(
app/tests/util/connections.py:90: in create_bob_alice_connection
    await assert_both_connections_ready(
app/tests/util/connections.py:53: in assert_both_connections_ready
    await assert_both_webhooks_received(
app/tests/util/webhooks.py:132: in assert_both_webhooks_received
    results = await asyncio.gather(
app/tests/util/webhooks.py:128: in check_webhook
    return await check_webhook_state(
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential_request[clean-clean-clean-clean-clean-v2]

failed on setup with "httpx.ConnectError: All connection attempts failed"
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

anyio_backend = 'asyncio', args = ()
kwargs = {'alice_member_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced23458e0>, 'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>, 'test_mode': 'clean'}
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fced1fe74d0>

    def wrapper(*args, anyio_backend, **kwargs):  # type: ignore[no-untyped-def]
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(func):
                yield from runner.run_asyncgen_fixture(func, kwargs)
            else:
>               yield runner.run_fixture(func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1987: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:687: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1957: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1932: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/member_connections.py:46: in faber_and_alice_connection
    bob_alice_connection = await create_connection_by_test_mode(
app/tests/util/connections.py:169: in create_connection_by_test_mode
    return await create_bob_alice_connection(
app/tests/util/connections.py:90: in create_bob_alice_connection
    await assert_both_connections_ready(
app/tests/util/connections.py:53: in assert_both_connections_ready
    await assert_both_webhooks_received(
app/tests/util/webhooks.py:132: in assert_both_webhooks_received
    results = await asyncio.gather(
app/tests/util/webhooks.py:128: in check_webhook
    return await check_webhook_state(
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

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

failed on setup with "httpx.ConnectError: All connection attempts failed"
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

anyio_backend = 'asyncio', args = ()
kwargs = {'alice_member_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced2fee390>, 'faber_client': <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>, 'test_mode': 'clean'}
backend_name = 'asyncio', backend_options = {}
runner = <anyio._backends._asyncio.TestRunner object at 0x7fced1fe74d0>

    def wrapper(*args, anyio_backend, **kwargs):  # type: ignore[no-untyped-def]
        backend_name, backend_options = extract_backend_and_options(anyio_backend)
        if has_backend_arg:
            kwargs["anyio_backend"] = anyio_backend
    
        with get_runner(backend_name, backend_options) as runner:
            if isasyncgenfunction(func):
                yield from runner.run_asyncgen_fixture(func, kwargs)
            else:
>               yield runner.run_fixture(func, kwargs)

/usr/local/lib/python3.12/site-packages/anyio/pytest_plugin.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1987: in run_fixture
    retval = self.get_loop().run_until_complete(
/usr/local/lib/python3.12/asyncio/base_events.py:687: in run_until_complete
    return future.result()
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1957: in _call_in_runner_task
    return await future
/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py:1932: in _run_tests_and_fixtures
    retval = await coro
app/tests/fixtures/member_connections.py:46: in faber_and_alice_connection
    bob_alice_connection = await create_connection_by_test_mode(
app/tests/util/connections.py:169: in create_connection_by_test_mode
    return await create_bob_alice_connection(
app/tests/util/connections.py:90: in create_bob_alice_connection
    await assert_both_connections_ready(
app/tests/util/connections.py:53: in assert_both_connections_ready
    await assert_both_webhooks_received(
app/tests/util/webhooks.py:132: in assert_both_webhooks_received
    results = await asyncio.gather(
app/tests/util/webhooks.py:128: in check_webhook
    return await check_webhook_state(
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

import pytest
from assertpy import assert_that
Expand Down Expand Up @@ -70,7 +70,7 @@

assert_that(accept_response.status_code).is_equal_to(200)
assert_that(oob_record).contains("created_at", "oob_id", "invitation")
assert await check_webhook_state(

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential_oob[clean-clean-clean-clean-v1]

httpx.ConnectError: All connection attempts failed
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>
schema_definition = CredentialSchema(id='Bo9W24g9VmLCnWopu5LJJm:2:test_schema:28.78.5', name='test_schema', version='28.78.5', attribute_names=['name', 'speed', 'age'])
credential_definition_id = 'R5xD9XxcVJHcgQ7bcAe79T:3:CL:16904:tag'
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d580>
protocol_version = 'v1'

    @pytest.mark.anyio
    @pytest.mark.parametrize("protocol_version", ["v1", "v2"])
    async def test_send_credential_oob(
        faber_client: RichAsyncClient,
        schema_definition: CredentialSchema,
        credential_definition_id: str,
        alice_member_client: RichAsyncClient,
        protocol_version: str,
    ):
        credential = {
            "protocol_version": protocol_version,
            "indy_credential_detail": {
                "credential_definition_id": credential_definition_id,
                "attributes": sample_credential_attributes,
            },
        }
    
        response = await faber_client.post(
            CREDENTIALS_BASE_PATH + "/create-offer",
            json=credential,
        )
    
        data = response.json()
        assert_that(data).contains("credential_exchange_id")
        assert_that(data).has_state("offer-sent")
        assert_that(data).has_protocol_version(protocol_version)
        assert_that(data).has_attributes(sample_credential_attributes)
        assert_that(data).has_schema_id(schema_definition.id)
    
        cred_ex_id = data["credential_exchange_id"]
    
        try:
            invitation_response = await faber_client.post(
                OOB_BASE_PATH + "/create-invitation",
                json={
                    "create_connection": False,
                    "use_public_did": False,
                    "attachments": [{"id": cred_ex_id[3:], "type": "credential-offer"}],
                },
            )
            assert_that(invitation_response.status_code).is_equal_to(200)
    
            invitation = (invitation_response.json())["invitation"]
    
            thread_id = invitation["requests~attach"][0]["data"]["json"]["@id"]
    
            accept_response = await alice_member_client.post(
                OOB_BASE_PATH + "/accept-invitation",
                json={"invitation": invitation},
            )
    
            oob_record = accept_response.json()
    
            assert_that(accept_response.status_code).is_equal_to(200)
            assert_that(oob_record).contains("created_at", "oob_id", "invitation")
>           assert await check_webhook_state(
                client=alice_member_client,
                topic="credentials",
                state="offer-received",
                filter_map={
                    "thread_id": thread_id,
                },
            )

app/tests/e2e/issuer/test_indy_credentials.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_send_credential_oob[clean-clean-clean-clean-v2]

httpx.ConnectError: All connection attempts failed
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>
schema_definition = CredentialSchema(id='Bo9W24g9VmLCnWopu5LJJm:2:test_schema:28.78.5', name='test_schema', version='28.78.5', attribute_names=['name', 'speed', 'age'])
credential_definition_id = 'R5xD9XxcVJHcgQ7bcAe79T:3:CL:16904:tag'
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced2325700>
protocol_version = 'v2'

    @pytest.mark.anyio
    @pytest.mark.parametrize("protocol_version", ["v1", "v2"])
    async def test_send_credential_oob(
        faber_client: RichAsyncClient,
        schema_definition: CredentialSchema,
        credential_definition_id: str,
        alice_member_client: RichAsyncClient,
        protocol_version: str,
    ):
        credential = {
            "protocol_version": protocol_version,
            "indy_credential_detail": {
                "credential_definition_id": credential_definition_id,
                "attributes": sample_credential_attributes,
            },
        }
    
        response = await faber_client.post(
            CREDENTIALS_BASE_PATH + "/create-offer",
            json=credential,
        )
    
        data = response.json()
        assert_that(data).contains("credential_exchange_id")
        assert_that(data).has_state("offer-sent")
        assert_that(data).has_protocol_version(protocol_version)
        assert_that(data).has_attributes(sample_credential_attributes)
        assert_that(data).has_schema_id(schema_definition.id)
    
        cred_ex_id = data["credential_exchange_id"]
    
        try:
            invitation_response = await faber_client.post(
                OOB_BASE_PATH + "/create-invitation",
                json={
                    "create_connection": False,
                    "use_public_did": False,
                    "attachments": [{"id": cred_ex_id[3:], "type": "credential-offer"}],
                },
            )
            assert_that(invitation_response.status_code).is_equal_to(200)
    
            invitation = (invitation_response.json())["invitation"]
    
            thread_id = invitation["requests~attach"][0]["data"]["json"]["@id"]
    
            accept_response = await alice_member_client.post(
                OOB_BASE_PATH + "/accept-invitation",
                json={"invitation": invitation},
            )
    
            oob_record = accept_response.json()
    
            assert_that(accept_response.status_code).is_equal_to(200)
            assert_that(oob_record).contains("created_at", "oob_id", "invitation")
>           assert await check_webhook_state(
                client=alice_member_client,
                topic="credentials",
                state="offer-received",
                filter_map={
                    "thread_id": thread_id,
                },
            )

app/tests/e2e/issuer/test_indy_credentials.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError
client=alice_member_client,
topic="credentials",
state="offer-received",
Expand Down Expand Up @@ -160,7 +160,7 @@

cred_ex_id = data["credential_exchange_id"]
try:
assert await check_webhook_state(

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_create_offer[clean-clean-clean-v1]

httpx.ConnectError: All connection attempts failed
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>
schema_definition = CredentialSchema(id='Bo9W24g9VmLCnWopu5LJJm:2:test_schema:28.78.5', name='test_schema', version='28.78.5', attribute_names=['name', 'speed', 'age'])
credential_definition_id = 'R5xD9XxcVJHcgQ7bcAe79T:3:CL:16904:tag'
protocol_version = 'v1'

    @pytest.mark.anyio
    @pytest.mark.parametrize("protocol_version", ["v1", "v2"])
    async def test_create_offer(
        faber_client: RichAsyncClient,
        schema_definition: CredentialSchema,
        credential_definition_id: str,
        protocol_version: str,
    ):
        credential = {
            "protocol_version": protocol_version,
            "indy_credential_detail": {
                "credential_definition_id": credential_definition_id,
                "attributes": sample_credential_attributes,
            },
        }
    
        response = await faber_client.post(
            CREDENTIALS_BASE_PATH + "/create-offer",
            json=credential,
        )
    
        data = response.json()
        assert_that(data).contains("credential_exchange_id")
        assert_that(data).has_state("offer-sent")
        assert_that(data).has_protocol_version(protocol_version)
        assert_that(data).has_attributes(sample_credential_attributes)
        assert_that(data).has_schema_id(schema_definition.id)
    
        cred_ex_id = data["credential_exchange_id"]
        try:
>           assert await check_webhook_state(
                client=faber_client,
                topic="credentials",
                state="offer-sent",
                filter_map={
                    "credential_exchange_id": cred_ex_id,
                },
            )

app/tests/e2e/issuer/test_indy_credentials.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError

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

View workflow job for this annotation

GitHub Actions / JUnit Test Report

test_indy_credentials.test_create_offer[clean-clean-clean-v2]

httpx.ConnectError: All connection attempts failed
Raw output
@contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
>           yield

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:373: in handle_async_request
    resp = await self._pool.handle_async_request(req)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:216: in handle_async_request
    raise exc from None
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection_pool.py:196: in handle_async_request
    response = await connection.handle_async_request(
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:99: in handle_async_request
    raise exc
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:76: in handle_async_request
    stream = await self._connect(request)
/usr/local/lib/python3.12/site-packages/httpcore/_async/connection.py:122: in _connect
    stream = await self._network_backend.connect_tcp(**kwargs)
/usr/local/lib/python3.12/site-packages/httpcore/_backends/auto.py:30: in connect_tcp
    return await self._backend.connect_tcp(
/usr/local/lib/python3.12/site-packages/httpcore/_backends/anyio.py:114: in connect_tcp
    with map_exceptions(exc_map):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio.BrokenResourceError'>: <class 'httpcore.ConnectError'>}

    @contextlib.contextmanager
    def map_exceptions(map: ExceptionMapping) -> Iterator[None]:
        try:
            yield
        except Exception as exc:  # noqa: PIE786
            for from_exc, to_exc in map.items():
                if isinstance(exc, from_exc):
>                   raise to_exc(exc) from exc
E                   httpcore.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpcore/_exceptions.py:14: ConnectError

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

faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fced230d970>
schema_definition = CredentialSchema(id='Bo9W24g9VmLCnWopu5LJJm:2:test_schema:28.78.5', name='test_schema', version='28.78.5', attribute_names=['name', 'speed', 'age'])
credential_definition_id = 'R5xD9XxcVJHcgQ7bcAe79T:3:CL:16904:tag'
protocol_version = 'v2'

    @pytest.mark.anyio
    @pytest.mark.parametrize("protocol_version", ["v1", "v2"])
    async def test_create_offer(
        faber_client: RichAsyncClient,
        schema_definition: CredentialSchema,
        credential_definition_id: str,
        protocol_version: str,
    ):
        credential = {
            "protocol_version": protocol_version,
            "indy_credential_detail": {
                "credential_definition_id": credential_definition_id,
                "attributes": sample_credential_attributes,
            },
        }
    
        response = await faber_client.post(
            CREDENTIALS_BASE_PATH + "/create-offer",
            json=credential,
        )
    
        data = response.json()
        assert_that(data).contains("credential_exchange_id")
        assert_that(data).has_state("offer-sent")
        assert_that(data).has_protocol_version(protocol_version)
        assert_that(data).has_attributes(sample_credential_attributes)
        assert_that(data).has_schema_id(schema_definition.id)
    
        cred_ex_id = data["credential_exchange_id"]
        try:
>           assert await check_webhook_state(
                client=faber_client,
                topic="credentials",
                state="offer-sent",
                filter_map={
                    "credential_exchange_id": cred_ex_id,
                },
            )

app/tests/e2e/issuer/test_indy_credentials.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
app/tests/util/webhooks.py:60: in check_webhook_state
    event = await listener.wait_for_event(
app/tests/util/sse_listener.py:72: in wait_for_event
    async with client.stream(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1617: in stream
    response = await self.send(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1661: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1689: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1726: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_client.py:1763: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:372: in handle_async_request
    with map_httpcore_exceptions():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextlib.contextmanager
    def map_httpcore_exceptions() -> typing.Iterator[None]:
        try:
            yield
        except Exception as exc:
            mapped_exc = None
    
            for from_exc, to_exc in HTTPCORE_EXC_MAP.items():
                if not isinstance(exc, from_exc):
                    continue
                # We want to map to the most specific exception we can find.
                # Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to
                # `httpx.ReadTimeout`, not just `httpx.TimeoutException`.
                if mapped_exc is None or issubclass(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            if mapped_exc is None:  # pragma: no cover
                raise
    
            message = str(exc)
>           raise mapped_exc(message) from exc
E           httpx.ConnectError: All connection attempts failed

/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py:86: ConnectError
client=faber_client,
topic="credentials",
state="offer-sent",
Expand Down Expand Up @@ -302,9 +302,10 @@
response = await faber_client.post(
f"{CREDENTIALS_BASE_PATH}/revoke",
json={
"credential_definition_id": credential_definition_id_revocable,
"credential_exchange_id": faber_credential_exchange_id,
"auto_publish_on_ledger": True,
},
)

assert response.status_code == 204
assert response.status_code == 200
assert len(response.json()["cred_rev_ids_published"]) == 1
Loading
Loading