Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: don't check function status to reduce flakiness #366

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down