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

🔧 increase publish-revocations timeout and make configurable #987

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion app/routes/revocation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import os
from typing import Optional

from aries_cloudcontroller import IssuerCredRevRecord, RevRegWalletUpdatedResult
Expand All @@ -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(
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions app/tests/e2e/verifier/test_proof_revoked_credential.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import time
from typing import List

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading