From a4b24f4b9fb4b9c702b8a3a9612a97dbb33721c5 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 29 Apr 2025 12:26:17 +0800 Subject: [PATCH 1/2] test: padding 4 node cluster --- tests/data_integrity/test_data_integrity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data_integrity/test_data_integrity.py b/tests/data_integrity/test_data_integrity.py index ebc8797..03ae355 100644 --- a/tests/data_integrity/test_data_integrity.py +++ b/tests/data_integrity/test_data_integrity.py @@ -24,7 +24,7 @@ class TestDataIntegrity(StepsDataAvailability): rcv_data = self.get_data_range(node, to_app_id(1), to_index(0), to_index(5)) rcv_data_json = json.dumps(rcv_data) - reconstructed_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json]) + reconstructed_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json], decode_only=True) if DATA_TO_DISPERSE[1] == reconstructed_data: test_results.append(node.name()) From 9670499e7735ca73dd99b235d1ae7622b8936122 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 29 Apr 2025 15:35:57 +0800 Subject: [PATCH 2/2] fix: padding 4 node cluster - error handling for invalid requests --- tests/data_integrity/test_data_integrity.py | 2 +- tests/dos_robustness/test_high_load_dos.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/data_integrity/test_data_integrity.py b/tests/data_integrity/test_data_integrity.py index 03ae355..cc5d85b 100644 --- a/tests/data_integrity/test_data_integrity.py +++ b/tests/data_integrity/test_data_integrity.py @@ -47,7 +47,7 @@ class TestDataIntegrity(StepsDataAvailability): rcv_data = self.get_data_range(node, to_app_id(1), to_index(0), to_index(5)) rcv_data_json = json.dumps(rcv_data) - reconstructed_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json]) + reconstructed_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json], decode_only=True) if DATA_TO_DISPERSE[1] == reconstructed_data: test_results.append(node.name()) diff --git a/tests/dos_robustness/test_high_load_dos.py b/tests/dos_robustness/test_high_load_dos.py index e304dae..5eb256f 100644 --- a/tests/dos_robustness/test_high_load_dos.py +++ b/tests/dos_robustness/test_high_load_dos.py @@ -158,9 +158,10 @@ class TestHighLoadDos(StepsDataAvailability): response = self.disperse_data( DATA_TO_DISPERSE[6], to_app_id(1), to_index(0), client_node=dispersal_cl, timeout_duration=0, send_invalid=invalid ) - assert response.status_code == 200, f"Dispersal failed with status code {response.status_code}" + assert response.status_code == 200, f"Dispersal failed with unexpected status code {response.status_code}" successful_dispersals += 1 - except AssertionError: + except Exception as ex: + assert "422" in str(ex), f"Unexpected error: {ex}" if not invalid: unsuccessful_dispersals += 1