Skip to content
Merged
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
10 changes: 7 additions & 3 deletions cardano_node_tests/utils/submit_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Utilities for `cardano-submit-api` REST service."""

import binascii
import contextlib
import dataclasses
import json
import logging
Expand Down Expand Up @@ -66,13 +67,16 @@ def post_cbor(*, cbor_file: clusterlib.FileType, url: str) -> requests.Response:
if i > 1:
LOGGER.warning("Resubmitting transaction to submit-api.")

try:
response = None
with contextlib.suppress(requests.exceptions.ReadTimeout):
response = http_client.get_session().post(
url, headers=headers, data=cbor_binary, timeout=60
)
except requests.exceptions.ReadTimeout:

if response is not None and not response and "MempoolTxTooSlow" in response.text:
# Repeat the request as the transaction didn't make it to mempool
pass
else:
elif response is not None:
break

time.sleep(random.random())
Expand Down
Loading