Add small sleep between create and get secrets
In HA mode create and get requests might go to
different backends. In case when dogtag is used sync of keys
might take some time.
Change-Id: I3450046ed84b6179fe386cbda6839de66ebe58d6
Related-Prod: PROD-25025
diff --git a/barbican_tempest_plugin/tests/api/test_secrets.py b/barbican_tempest_plugin/tests/api/test_secrets.py
index da2afcb..5ce1c9f 100644
--- a/barbican_tempest_plugin/tests/api/test_secrets.py
+++ b/barbican_tempest_plugin/tests/api/test_secrets.py
@@ -17,6 +17,7 @@
from datetime import datetime
from datetime import timedelta
import os
+import time
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
@@ -95,6 +96,12 @@
# Associate the payload with the created secret
self.secret_client.put_secret_payload(uuid, key)
+ # NOTE(vsaienko): in HA mode create and get requests might go to
+ # different backends. In case when dogtag is used sync of keys
+ # might take some time.
+ # TODO(vsaienko): switch to retry logic when get 404 exception
+ time.sleep(2)
+
# Retrieve the payload
payload = self.secret_client.get_secret_payload(uuid)
self.assertEqual(key, base64.b64encode(payload))