mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-07 23:53:07 +00:00
fix: move fixture to class level
This commit is contained in:
parent
a373193bdb
commit
d19d224813
@ -8,20 +8,18 @@ from src.steps.da import StepsDataAvailability, logger
|
|||||||
from src.test_data import DATA_TO_DISPERSE
|
from src.test_data import DATA_TO_DISPERSE
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("setup_2_node_cluster")
|
||||||
class TestHighLoadDos(StepsDataAvailability):
|
class TestHighLoadDos(StepsDataAvailability):
|
||||||
main_nodes = []
|
main_nodes = []
|
||||||
client_nodes = []
|
client_nodes = []
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_2_node_cluster")
|
|
||||||
def test_sustained_high_rate_upload(self):
|
def test_sustained_high_rate_upload(self):
|
||||||
timeout = 60
|
timeout = 60
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
successful_dispersals = 0
|
successful_dispersals = 0
|
||||||
unsuccessful_dispersals = 0
|
unsuccessful_dispersals = 0
|
||||||
|
|
||||||
while True:
|
while time.time() - start_time < timeout:
|
||||||
if time.time() - start_time > timeout:
|
|
||||||
break
|
|
||||||
|
|
||||||
delay(0.01)
|
delay(0.01)
|
||||||
try:
|
try:
|
||||||
@ -40,7 +38,6 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
|
|
||||||
assert failure_ratio < 0.20, f"Dispersal failure ratio {failure_ratio} too high"
|
assert failure_ratio < 0.20, f"Dispersal failure ratio {failure_ratio} too high"
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_2_node_cluster")
|
|
||||||
def test_sustained_high_rate_download(self):
|
def test_sustained_high_rate_download(self):
|
||||||
timeout = 60
|
timeout = 60
|
||||||
successful_downloads = 0
|
successful_downloads = 0
|
||||||
@ -54,9 +51,7 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
delay(5)
|
delay(5)
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
while True:
|
while time.time() - start_time < timeout:
|
||||||
if time.time() - start_time > timeout:
|
|
||||||
break
|
|
||||||
|
|
||||||
delay(0.01)
|
delay(0.01)
|
||||||
try:
|
try:
|
||||||
@ -72,7 +67,6 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
|
|
||||||
assert failure_ratio < 0.20, f"Data download failure ratio {failure_ratio} too high"
|
assert failure_ratio < 0.20, f"Data download failure ratio {failure_ratio} too high"
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_2_node_cluster")
|
|
||||||
def test_sustained_high_rate_mixed(self):
|
def test_sustained_high_rate_mixed(self):
|
||||||
timeout = 60
|
timeout = 60
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
@ -81,9 +75,7 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
successful_downloads = 0
|
successful_downloads = 0
|
||||||
unsuccessful_downloads = 0
|
unsuccessful_downloads = 0
|
||||||
|
|
||||||
while True:
|
while time.time() - start_time < timeout:
|
||||||
if time.time() - start_time > timeout:
|
|
||||||
break
|
|
||||||
|
|
||||||
delay(0.01)
|
delay(0.01)
|
||||||
try:
|
try:
|
||||||
@ -122,9 +114,7 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
successful_downloads = 0
|
successful_downloads = 0
|
||||||
unsuccessful_downloads = 0
|
unsuccessful_downloads = 0
|
||||||
|
|
||||||
while True:
|
while time.time() - start_time < timeout:
|
||||||
if time.time() - start_time > timeout:
|
|
||||||
break
|
|
||||||
|
|
||||||
dispersal_cl, download_cl = random.choice(self.client_nodes[1::2]), random.choice(self.client_nodes[::2])
|
dispersal_cl, download_cl = random.choice(self.client_nodes[1::2]), random.choice(self.client_nodes[::2])
|
||||||
|
|
||||||
@ -165,9 +155,7 @@ class TestHighLoadDos(StepsDataAvailability):
|
|||||||
successful_downloads = 0
|
successful_downloads = 0
|
||||||
unsuccessful_downloads = 0
|
unsuccessful_downloads = 0
|
||||||
|
|
||||||
while True:
|
while time.time() - start_time < timeout:
|
||||||
if time.time() - start_time > timeout:
|
|
||||||
break
|
|
||||||
|
|
||||||
dispersal_cl, download_cl = random.choice(self.client_nodes[1::2]), random.choice(self.client_nodes[::2])
|
dispersal_cl, download_cl = random.choice(self.client_nodes[1::2]), random.choice(self.client_nodes[::2])
|
||||||
invalid = random.choice([False, True])
|
invalid = random.choice([False, True])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user