Re: Introduce pg_receivewal gzip compression tests
gkokolatos@pm.me
From: gkokolatos@pm.me
To: Gilles Darold <gilles@darold.net>
Cc: Michael Paquier <michael@paquier.xyz>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-12T15:01:16Z
Lists: pgsql-hackers
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Monday, July 12th, 2021 at 13:00, Gilles Darold <gilles@darold.net> wrote: > Le 12/07/2021 à 12:27, gkokolatos@pm.me a écrit : > > > > > > Shouldn't this be coded as a loop going through @gzip_wals? > > > > > > > > > > I would hope that there is only one gz file created. There is a line > > > > > > > > further up that tests exactly that. > > > > > > > > - is (scalar(@gzip_wals), 1, "one gzip compressed WAL was created"); > > > > > > > > Let me amend that. The line should be instead: > > > > > > is (scalar(keys @gzip_wals), 1, "one gzip compressed WAL was created"); > > > > > > To properly test that there is one entry. > > > > > > Let me provide with v2 to fix this. > > The following tests are not correct in Perl even if Perl returns the > > right value. > > + is (scalar(keys @gzip_wals), 1, "one gzip compressed WAL was created"); > > + is (scalar(keys @gzip_partial_wals), 1, > > + "one partial gzip compressed WAL was created"); > > Function keys or values are used only with hashes but here you are using > > arrays. To obtain the length of the array you can just use the scalar > > function as Perl returns the length of the array when it is called in a > > scalar context. Please use the following instead: > > + is (scalar(@gzip_wals), 1, "one gzip compressed WAL was created"); > > + is (scalar(@gzip_partial_wals), 1, > > + "one partial gzip compressed WAL was created"); You are absolutely correct. I had used that in v1, yet since it got called out I doubted myself, assumed I was wrong and the rest is history. I shall ament the amendment for v3 of the patch. Cheers, //Georgios > > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Gilles Darold > > http://www.darold.net/
Commits
-
Re-enable TAP tests of pg_receivewal for ZLIB on Windows
- 91d395f47aa9 15.0 landed
-
Fix some issues with WAL segment opening for pg_receivewal --compress
- 11dbad74c104 10.18 landed
- 795a9166e2e1 11.13 landed
- b9a0de15eb29 12.8 landed
- fb2b86015a9f 13.4 landed
- 3a0d2d0cbaf3 14.0 landed
- 7fbe0c8c4d4f 15.0 landed
-
Disable tests involving ZLIB on Windows for pg_receivewal
- 6cea447e6a10 15.0 landed
-
Fix portability issue with gzip in TAP test of pg_receivewal
- 0da3c1bc3f72 15.0 landed
-
Add TAP tests for ZLIB compression for pg_receivewal
- ffc9ddaea33f 15.0 landed