diff --git a/app/routes/revocation.py b/app/routes/revocation.py index 73e73f9c1..be9f418be 100644 --- a/app/routes/revocation.py +++ b/app/routes/revocation.py @@ -1,4 +1,5 @@ import asyncio +import os from typing import Optional from aries_cloudcontroller import IssuerCredRevRecord, RevRegWalletUpdatedResult @@ -23,6 +24,9 @@ router = APIRouter(prefix="/v1/issuer/credentials", tags=["revocation"]) +# Config for /publish-revocations +publish_revocations_timeout = int(os.getenv("PUBLISH_REVOCATIONS_TIMEOUT", "60")) + @router.post("/revoke", summary="Revoke a Credential (if revocable)") async def revoke_credential( @@ -209,7 +213,7 @@ async def publish_revocations( field_name="state", expected_value="transaction_acked", logger=bound_logger, - max_attempts=30, + max_attempts=publish_revocations_timeout, retry_delay=1, ) except asyncio.TimeoutError as e: diff --git a/app/tests/e2e/verifier/test_proof_revoked_credential.py b/app/tests/e2e/verifier/test_proof_revoked_credential.py index b672e1cc2..a40cc677c 100644 --- a/app/tests/e2e/verifier/test_proof_revoked_credential.py +++ b/app/tests/e2e/verifier/test_proof_revoked_credential.py @@ -1,3 +1,4 @@ +import asyncio import time from typing import List @@ -34,7 +35,7 @@ async def test_proof_revoked_credential( alice_member_client: RichAsyncClient, acme_and_alice_connection: AcmeAliceConnect, ): - time.sleep(10) # moment for revocation registry to update + await asyncio.sleep(14) # moment for revocation registry to update # todo: remove sleep when issue resolved: https://github.com/openwallet-foundation/acapy/issues/3018 # Do proof request @@ -124,7 +125,7 @@ async def test_regression_proof_revoked_credential( alice_member_client: RichAsyncClient, acme_and_alice_connection: AcmeAliceConnect, ): - time.sleep(10) # moment for revocation registry to update + await asyncio.sleep(14) # moment for revocation registry to update # todo: remove sleep when issue resolved: https://github.com/openwallet-foundation/acapy/issues/3018 referent = get_or_issue_regression_cred_revoked.referent