Skip to content
Snippets Groups Projects
Verified Commit 67b62df9 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

fix: avoid requests to invalid hostname

Implementation of `net_box` in `tarantool-module` resolves hostnames
with a `to_socket_addrs` function that is blocking. Pytest uses
fake addresses in one test, and sometimes it results in 5-second
blockage and consequent test failure.

This patch only provides a workaround. It makes a connection to fail
even before the blocking DNS request.

See also:
- https://git.picodata.io/picodata/picodata/tarantool-module/-/issues/81
parent 9439cbdd
No related branches found
No related tags found
1 merge request!100fix: avoid requests to invalid hostname
Pipeline #4893 passed
......@@ -23,7 +23,10 @@ def fake_join(peer: Instance, id: str, timeout: float):
args = (
f"{id}", # instance_id
None, # replicaset_id
f"{id}:3301", # address
# Workaround slow address resolving. Intentionally use
# invalid address format to eliminate blocking DNS requests.
# See https://git.picodata.io/picodata/picodata/tarantool-module/-/issues/81
f"nowhere/{id}", # address
False, # voter
)
return peer.call(".raft_join", *args, timeout=timeout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment