functional_tests: avoid sweep_single spent status race

This commit is contained in:
selsta
2026-07-03 14:04:12 +02:00
parent ed3283dec9
commit 80402158fd
+3
View File
@@ -29,6 +29,7 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import json
import time
import util_resources
import pprint
from deepdiff import DeepDiff
@@ -684,6 +685,8 @@ class TransferTest():
res = self.wallet[0].sweep_single('44Kbx4sJ7JDRDV5aAhLJzQCjDz2ViLRduE3ijDZu3osWKBjMGkV1XPk4pfDUMqt1Aiezvephdqm6YD19GKFD9ZcXVUTp6BW', key_image = ki)
assert len(res.tx_hash) == 64
tx_hash = res.tx_hash
# Avoid racing the txpool relay state update before checking spent status
time.sleep(0.1)
res = daemon.is_key_image_spent([ki])
assert len(res.spent_status) == 1
assert res.spent_status[0] == 2