test: attach secondary IP

This commit is contained in:
Roman 2025-01-07 20:08:38 +08:00
parent ce7f08fc70
commit a9307874c8
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 8 additions and 8 deletions

View File

@ -62,9 +62,9 @@ class DockerManager:
network=NETWORK_NAME, network=NETWORK_NAME,
) )
# network = self._client.networks.get(NETWORK_NAME) network = self._client.networks.get(NETWORK_NAME)
# logger.debug(f"docker network connect --ip {container_ip} {NETWORK_NAME} {container.id}") logger.debug(f"docker network connect --ip {container_ip} {NETWORK_NAME} {container.id}")
# network.connect(container, ipv4_address=container_ip) network.connect(container, ipv4_address=container_ip)
logger.debug(f"Container started with ID {container.short_id}. Setting up logs at {log_path}") logger.debug(f"Container started with ID {container.short_id}. Setting up logs at {log_path}")
log_thread = threading.Thread(target=self._log_container_output, args=(container, log_path)) log_thread = threading.Thread(target=self._log_container_output, args=(container, log_path))

View File

@ -85,11 +85,11 @@ class NomosNode:
logger.debug(f"Container returned {self._container}") logger.debug(f"Container returned {self._container}")
logger.debug(f"Started container from image {self._image_name}. " f"REST: {getattr(self, '_tcp_port', 'N/A')}") logger.debug(f"Started container from image {self._image_name}. " f"REST: {getattr(self, '_tcp_port', 'N/A')}")
try: # try:
self.ensure_ready(timeout_duration=wait_for_node_sec) # self.ensure_ready(timeout_duration=wait_for_node_sec)
except Exception as ex: # except Exception as ex:
logger.error(f"REST service did not become ready in time: {ex}") # logger.error(f"REST service did not become ready in time: {ex}")
raise # raise
def ensure_ready(self, timeout_duration=10): def ensure_ready(self, timeout_duration=10):
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(0.1), reraise=True) @retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(0.1), reraise=True)