mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-05-05 00:53:10 +00:00
fix: get data range from remote host
This commit is contained in:
parent
7c4e0a64ec
commit
04f2f1ad85
@ -70,13 +70,17 @@ class StepsDataAvailability(StepsCommon):
|
|||||||
return disperse()
|
return disperse()
|
||||||
|
|
||||||
@allure.step
|
@allure.step
|
||||||
def get_data_range(self, node, app_id, start, end, timeout_duration=45):
|
def get_data_range(self, node, app_id, start, end, client_node=None, timeout_duration=45):
|
||||||
@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)
|
||||||
def get_range():
|
def get_range():
|
||||||
response = []
|
response = []
|
||||||
query = prepare_get_range_request(app_id, start, end)
|
query = prepare_get_range_request(app_id, start, end)
|
||||||
try:
|
try:
|
||||||
response = node.send_get_data_range_request(query)
|
if client_node is None:
|
||||||
|
response = node.send_get_data_range_request(query)
|
||||||
|
else:
|
||||||
|
client_node.set_rest_api(node.name(), node.api_port_internal())
|
||||||
|
response = client_node.send_get_data_range_request(query)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex)
|
assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex)
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -125,24 +126,23 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
if time.time() - start_time > timeout:
|
if time.time() - start_time > timeout:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
dispersal_cl, download_cl = random.choice(self.client_nodes), random.choice(self.client_nodes)
|
||||||
|
|
||||||
delay(0.01)
|
delay(0.01)
|
||||||
try:
|
try:
|
||||||
response = self.disperse_data(DATA_TO_DISPERSE[6], to_app_id(1), to_index(0), client_node=self.client_nodes[0], timeout_duration=0)
|
response = self.disperse_data(DATA_TO_DISPERSE[6], to_app_id(1), to_index(0), client_node=dispersal_cl, timeout_duration=0)
|
||||||
logger.debug(f"RESPONSE {response}")
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
successful_dispersals += 1
|
successful_dispersals += 1
|
||||||
else:
|
else:
|
||||||
unsuccessful_dispersals += 1
|
unsuccessful_dispersals += 1
|
||||||
except Exception as ex:
|
except Exception:
|
||||||
logger.debug(f"EXCEPTION {ex}")
|
|
||||||
unsuccessful_dispersals += 1
|
unsuccessful_dispersals += 1
|
||||||
|
|
||||||
delay(3600)
|
try:
|
||||||
# try:
|
self.get_data_range(self.node2, to_app_id(1), to_index(0), to_index(5), client_node=download_cl, timeout_duration=0)
|
||||||
# self.get_data_range(self.node2, to_app_id(1), to_index(0), to_index(5), timeout_duration=0)
|
successful_downloads += 1
|
||||||
# successful_downloads += 1
|
except Exception:
|
||||||
# except Exception:
|
unsuccessful_downloads += 1
|
||||||
# unsuccessful_downloads += 1
|
|
||||||
|
|
||||||
assert successful_dispersals > 0, "No successful dispersals"
|
assert successful_dispersals > 0, "No successful dispersals"
|
||||||
assert successful_downloads > 0, "No successful downloads"
|
assert successful_downloads > 0, "No successful downloads"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user