Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PBCKP-220] fix PGPROBAKUP_GDB=ON check#502

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
funny-falcon merged 6 commits intomasterfromPBCKP-220
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes fromall 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
1 change: 0 additions & 1 deletion.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,7 +50,6 @@
/docker-compose.yml
/Dockerfile
/Dockerfile.in
/run_tests.sh
/make_dockerfile.sh
/backup_restore.sh

Expand Down
26 changes: 7 additions & 19 deletionstests/Readme.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,31 +51,19 @@ Usage:
python -m unittest [-v] tests[.specific_module][.class.test]
```

### Troubleshooting FAQ
# Troubleshooting FAQ

#### python test failures
1.Test failure reason like
## Python tests failure
###1.Could not open extension "..."
```
testgres.exceptions.QueryException ERROR: could not open extension control file "/home/avaness/postgres/postgres.build/share/extension/amcheck.control": No such file or directory
testgres.exceptions.QueryException ERROR: could not open extension control file "<postgres_build_dir>/share/extension/amcheck.control": No such file or directory
```

*Solution*: you have no `<postgres_src_root>/contrib/` extensions installed
####Solution:

```commandline
cd <postgres_src_root>
make world install
```

2. Test failure

```
FAIL: test_help_6 (tests.option.OptionTest)
```

*Solution*: you didn't configure postgres build with `--enable-nls`
You have no `<postgres_src_root>/contrib/...` extension installed, please do

```commandline
cd <postgres_src_root>
make distclean
<your-./configure-cmdline> --enable-nls
make install-world
```
4 changes: 4 additions & 0 deletionstests/archive.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -228,6 +228,8 @@ def test_pgpro434_3(self):
Check pg_stop_backup_timeout, needed backup_timeout
Fixed in commit d84d79668b0c139 and assert fixed by ptrack 1.7
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -290,6 +292,8 @@ def test_pgpro434_4(self):
Check pg_stop_backup_timeout, libpq-timeout requested.
Fixed in commit d84d79668b0c139 and assert fixed by ptrack 1.7
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand Down
18 changes: 18 additions & 0 deletionstests/backup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1095,6 +1095,8 @@ def test_tablespace_handling_2(self):
# @unittest.skip("skip")
def test_drop_rel_during_full_backup(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1244,6 +1246,8 @@ def test_drop_db_during_full_backup(self):
# @unittest.skip("skip")
def test_drop_rel_during_backup_delta(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1313,6 +1317,8 @@ def test_drop_rel_during_backup_delta(self):
# @unittest.skip("skip")
def test_drop_rel_during_backup_page(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1445,6 +1451,8 @@ def test_basic_temp_slot_for_stream_backup(self):
# @unittest.skip("skip")
def test_backup_concurrent_drop_table(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1579,6 +1587,8 @@ def test_pg_11_adjusted_wal_segment_size(self):
# @unittest.skip("skip")
def test_sigint_handling(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1618,6 +1628,8 @@ def test_sigint_handling(self):
# @unittest.skip("skip")
def test_sigterm_handling(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -1656,6 +1668,8 @@ def test_sigterm_handling(self):
# @unittest.skip("skip")
def test_sigquit_handling(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -2906,6 +2920,8 @@ def test_incr_backup_filenode_map(self):
# @unittest.skip("skip")
def test_missing_wal_segment(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -3292,6 +3308,8 @@ def test_basic_backup_default_transaction_read_only(self):
# @unittest.skip("skip")
def test_backup_atexit(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand Down
9 changes: 4 additions & 5 deletionstests/checkdb.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,8 @@ class CheckdbTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_checkdb_amcheck_only_sanity(self):
""""""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand DownExpand Up@@ -544,11 +546,8 @@ def test_checkdb_checkunique(self):
# @unittest.skip("skip")
def test_checkdb_sigint_handling(self):
""""""
if not self.gdb:
self.skipTest(
"Specify PGPROBACKUP_GDB and build without "
"optimizations for run this test"
)
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand Down
7 changes: 2 additions & 5 deletionstests/delta.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -472,11 +472,8 @@ def test_delta_vacuum_full(self):
make node, make full and delta stream backups,
restore them and check data correctness
"""
if not self.gdb:
self.skipTest(
"Specify PGPROBACKUP_GDB and build without "
"optimizations for run this test"
)
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
Expand Down
28 changes: 20 additions & 8 deletionstests/helpers/ptrack_helpers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -180,8 +180,8 @@ def __init__(self, *args, **kwargs):
self.test_env['LC_MESSAGES'] = 'C'
self.test_env['LC_TIME'] = 'C'

self.gdb = 'PGPROBACKUP_GDB' inos.environ and \
os.environ['PGPROBACKUP_GDB'] == 'ON'
self.gdb = 'PGPROBACKUP_GDB' inself.test_env and \
self.test_env['PGPROBACKUP_GDB'] == 'ON'

self.paranoia = 'PG_PROBACKUP_PARANOIA' in self.test_env and \
self.test_env['PG_PROBACKUP_PARANOIA'] == 'ON'
Expand DownExpand Up@@ -810,7 +810,7 @@ def run_pb(self, command, asynchronous=False, gdb=False, old_binary=False, retur
if self.verbose:
print(self.cmd)
if gdb:
return GDBobj([binary_path] + command, self.verbose)
return GDBobj([binary_path] + command, self)
if asynchronous:
return subprocess.Popen(
[binary_path] + command,
Expand DownExpand Up@@ -1861,22 +1861,34 @@ def compare_pgdata(self, original_pgdata, restored_pgdata, exclusion_dict = dict
self.assertFalse(fail, error_message)

def gdb_attach(self, pid):
return GDBobj([str(pid)], self.verbose, attach=True)
return GDBobj([str(pid)], self, attach=True)

def _check_gdb_flag_or_skip_test(self):
if not self.gdb:
self.skipTest(
"Specify PGPROBACKUP_GDB and build without "
"optimizations for run this test"
)


class GdbException(Exception):
def __init__(self, message=False):
def __init__(self, message="False"):
self.message = message

def __str__(self):
return '\n ERROR: {0}\n'.format(repr(self.message))


class GDBobj(ProbackupTest):
def __init__(self, cmd,verbose, attach=False):
self.verbose = verbose
class GDBobj:
def __init__(self, cmd,env: ProbackupTest, attach=False):
self.verbose =env.verbose
self.output = ''

# Check gdb flag is set up
if not env.gdb:
raise GdbException("No `PGPROBACKUP_GDB=on` is set, "
"test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
"and be skipped")
# Check gdb presense
try:
gdb_version, _ = subprocess.Popen(
Expand Down
16 changes: 16 additions & 0 deletionstests/locking.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,8 @@ def test_locking_running_validate_1(self):
run validate, expect it to successfully executed,
concurrent RUNNING backup with pid file and active process is legal
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -72,6 +74,8 @@ def test_locking_running_validate_2(self):
RUNNING backup with pid file AND without active pid is legal,
but his status must be changed to ERROR and pid file is deleted
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -142,6 +146,8 @@ def test_locking_running_validate_2_specific_id(self):
RUNNING backup with pid file AND without active pid is legal,
but his status must be changed to ERROR and pid file is deleted
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -240,6 +246,8 @@ def test_locking_running_3(self):
RUNNING backup without pid file AND without active pid is legal,
his status must be changed to ERROR
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -310,6 +318,8 @@ def test_locking_restore_locked(self):
Expect restore to sucseed because read-only locks
do not conflict
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -352,6 +362,8 @@ def test_concurrent_delete_and_restore(self):
Expect restore to fail because validation of
intermediate backup is impossible
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -443,6 +455,8 @@ def test_locking_concurren_restore_and_delete(self):
and stop it in the middle, delete full backup.
Expect it to fail.
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand DownExpand Up@@ -585,6 +599,8 @@ def test_shared_lock(self):
"""
Make sure that shared lock leaves no files with pids
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand Down
4 changes: 4 additions & 0 deletionstests/logging.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,10 @@ class LogTest(ProbackupTest, unittest.TestCase):
# @unittest.expectedFailure
# PGPRO-2154
def test_log_rotation(self):
"""
"""
self._check_gdb_flag_or_skip_test()

fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp