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

fix(pytest): call stop for all instances even if stop raise exception #4339

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

adiholden
Copy link
Collaborator

The problem:
if calling stop for one of the instances raise and exception we did not call stop for the rest

Signed-off-by: adi_holden <adi@dragonflydb.io>
@adiholden adiholden requested a review from romange December 18, 2024 13:02
exceptions.append(e) # Collect the exception
if exceptions:
# Raise the first exception while preserving the others as context
raise Exception("One or more errors occurred while stopping instances")
Copy link
Collaborator

@romange romange Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider changing to this - so that the exception is actually shown

             first_exception = exceptions[0]
             raise Exception(
                 f"One or more errors occurred while stopping instances. "
                 f"First exception: {first_exception}"
             ) from first_exception

Signed-off-by: adi_holden <adi@dragonflydb.io>
@adiholden adiholden requested a review from romange December 18, 2024 14:05
@adiholden adiholden merged commit 3f68028 into main Dec 18, 2024
9 checks passed
@adiholden adiholden deleted the fix_pytest_not_terminating_instances branch December 18, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants