zlib decompression could mark error either as "data error" or
"buffer error". One of check did consider it, other didn't.
Make them same.
And use `assertRaises` for good (requires python 3.2 at least)
Pg15 now reports if it didn't met expected contrecord. Absence of this
message was long standing bug in previous postgres versions.
This situation could happen if WAL segment was rewritten after restart.
It causes "tests.validate.ValidateTest.test_validate_wal_unreal_values"
to hang but (looks like) for other reason: test tries to read "in future".
Probably we should stop reading logs here. But since we always did
continue here, lets continue as well.
Looks like os.walk may yield dirs unsorted.
This way "check if directory already here as part of larger directory"
man mistakenly skip short 'base/1' as "part of" 'base/12699'
Got in some tests:
```
Traceback (most recent call last):
File "pg_probackup/tests/replica.py", line 625, in test_replica_stop_lsn_null_offset
gdb_checkpointer = self.gdb_attach(bgwriter_pid)
File "pg_probackup/tests/helpers/ptrack_helpers.py", line 1984, in gdb_attach
return GDBobj([str(pid)], self, attach=True)
File "pg_probackup/tests/helpers/ptrack_helpers.py", line 2054, in __init__
line = self.get_line()
File "pg_probackup/tests/helpers/ptrack_helpers.py", line 2065, in get_line
line = self.proc.stdout.readline()
File "/usr/lib/python3.10/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 189: invalid continuation byte
```
Fixed with `errors='replace'`
and BugTest.test_minrecpoint_on_replica as well
Tests were broken with introduction of "startness" handling in
9924ab014 [PBCKP-304] extended testgres.PosgresNode to ...
since tests uses os.kill directly.
Here we assume backup_id == start_time.
It is really so at the moment, but could change in future.
Well, it almost always same. Sometime backup_id is set
while start_time is not set yet (backup creation). And
we had to fix places where start_time were changed without
change of backup_id.
C99 introduced compound literals (`(char[14]){0}` - literal of array).
Compound literals have same lifetime as block local variable, ie till
the end of block. There for it is save to initiate several of them in
same block and assume they are all live.
This way we may rewrite base36enc into macros which uses compound
literal instead of static variable to extend its result lifetime.