-
Notifications
You must be signed in to change notification settings - Fork 16
Description
At the moment, this is only an issue for our tests. Namely: app/tests/e2e/issuer/test_save_exchange_record.py::test_issue_credential_with_save_exchange_record
In this e2e test we validate that a 404 is raised when trying to fetch the credential exchange record, after the exchange was complete, and if save_exchange_record was set to False.
Previously, we've identified some race condition, where it may take a moment for the records to update. Therefore, a naive workaround was to add a sleep of 1 second. This is fairly "long" in computational terms, so it was thought to be sufficient.
This did make the test failure rare, but it can still occur -- i.e. it can happen that the record has still not been deleted, 1 second after the exchange was complete.
This should be fine for most client use cases, since a short delay is acceptable. But all we can know from the test failure is that it took more than 1 second, and so we can't guarantee that the bug is not actually that it never gets deleted ...
A possible solution would be to replace the 1 second sleep with some fast retry logic, so it can pass as quickly as possible, and only fails if it takes, let's say, more than 5 seconds.