From db716c07f9fccbc0c9e6ca11bc52a4919e0f5de7 Mon Sep 17 00:00:00 2001 From: SdgJlbl Date: Wed, 17 Jul 2024 17:13:13 +0200 Subject: [PATCH] chore: don't check function status to reduce flakiness Signed-off-by: SdgJlbl --- tests/test_network.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_network.py b/tests/test_network.py index cde2d5e6..43d4c073 100644 --- a/tests/test_network.py +++ b/tests/test_network.py @@ -177,7 +177,11 @@ def test_add_function(factory, client): function = client.add_function(spec) function_copy = client.get_function(function.key) + # fix status to avoid flakiness + status_copy = function_copy.status + function_copy.status = function.status assert function == function_copy + assert status_copy not in [substra.sdk.models.FunctionStatus.failed, substra.sdk.models.FunctionStatus.canceled] @pytest.mark.remote_only # No organization saved in the local backend @@ -199,7 +203,12 @@ def test_query_functions(factory, client): assert len(matching_functions) == 1 # ensure the list method returns the same information as the add method + # don't check the status to avoid flakiness + reference_status = function.status + status = matching_functions[0].status + matching_functions[0].status = reference_status assert function == matching_functions[0] + assert status not in [substra.sdk.models.FunctionStatus.failed, substra.sdk.models.FunctionStatus.canceled] @pytest.mark.parametrize(