-
Notifications
You must be signed in to change notification settings - Fork 4
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
Avoid hidden failures when dumping #38
base: main
Are you sure you want to change the base?
Avoid hidden failures when dumping #38
Conversation
6a82b05
to
43c5008
Compare
pgclone/run.py
Outdated
@@ -8,11 +8,24 @@ | |||
from pgclone import exceptions, logging | |||
|
|||
|
|||
def shell(cmd, ignore_errors=False, env=None): | |||
def _is_pipefail_supported(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set -o pipefail
is supported in most POSSIX shell implementations at this point, it was added to the spec in 2022 - but the user could still be missing it
39b00f6
to
275923b
Compare
def _is_pipefail_supported() -> bool: | ||
"""Check if the current shell supports pipefail.""" | ||
if sys.platform == "win32": | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may need a pragma: no cover here for the coverage check
@max-muoto See this Stack Overflow thread for what I am talking about. Any idea if this may be a problem for |
Thanks for the callout, let me double check and get back to you here! |
I recently ran into an issue where we were getting silent failures despite
pg_dump
failing. In particular had a client/server mismatch (client had a version of 16, with the server being on 17) - resulting in us creating empty dumps on S3.This PR sets pipefail when dumping to ensure capture failures in
pg_dump
. Currently none of the integration tests interact with S3, but if we want something I'm happy to add something mocking out the storage layer to simulate piping even when dumping locally.