fix: handle revocation registry race conditions for BDD integration tests#4056
Merged
swcurran merged 2 commits intoopenwallet-foundation:mainfrom Feb 19, 2026
Merged
Conversation
…sts and decommission flow Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
Signed-off-by: Patrick St-Louis <patrick.st-louis@opsecid.ca>
|
swcurran
approved these changes
Feb 19, 2026
Merged
ff137
reviewed
Feb 19, 2026
Comment on lines
+1534
to
+1540
| try: | ||
| await self.store_revocation_registry_definition(new_backup_reg) | ||
| except AnonCredsRevocationError: | ||
| LOGGER.debug( | ||
| "Registry %s already stored by event chain", | ||
| new_rev_reg_def_id, | ||
| ) |
Member
There was a problem hiding this comment.
It's a lil bit dubious to suppress an exception without checking what the exception is. The assumption here is that it can only fail in 1 way, but there should be some error detail that one can check to validate that assumption, and if something else went wrong, then raise or log at higher level.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes revocation-related BDD test failures (
features/revocation-api.feature) by addressing timing issues in the test helper and race conditions in the core revocation registry decommission flow.Changes
BDD test helper (
demo/runners/support/agent.py)register_schema_and_creddef_anoncredsthat waits up to 60s for the revocation registry to become active before returning, replacing reliance on a static 2s sleep that was insufficient on external ledgers like BCovrin.Revocation decommission flow (
acapy_agent/anoncreds/revocation/revocation.py)decommission_registrywhere both the directstore_revocation_registry_definitioncall and the async event chain tried to INSERT the same registry, causingAskarError: Duplicate entry. The direct store is now wrapped in a try/except that handles the duplicate gracefully.TypeError: 'IterEntryList' object is not iterableindecommission_registryby wrappingfetch_allresult inlist()for Python 3.13 compatibility.Active registry endpoint (
acapy_agent/anoncreds/routes/revocation/registry/routes.py)GET /anoncreds/revocation/active-registry/{cred_def_id}now returns HTTP 404 instead of an unhandled 500 when no active registry exists, reducing noisy error stack traces during expected polling.