pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gilles Darold <gilles@darold.net>
To: gkokolatos@pm.me
Cc: Michael Paquier <michael@paquier.xyz>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Introduce pg_receivewal gzip compression tests
Date: Mon, 12 Jul 2021 13:00:53 +0200
Message-ID: <3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net> (raw)
In-Reply-To: <AS-DklS9IbOb20QxukKOm4CjIYxptH5TpiJyiKF0zzW9wARr_PYFPFvqGPj-R-3LwcLGXGIIr4bvTXYQ1YCpR0B-y7SyQhn9yvFQZC6ldgA=@pm.me>
References: <07BK3Mk5aEOsTwGaY77qBVyf9GjoEzn8TMgHLyPGfEFPIpTEmoQuP2P4c7teesjSg-LPeUafsp1flnPeQYINMSMB_UpggJDoduB5EDYBqaQ=@protonmail.com>
	<YOvkR0F6i4AmmmUe@paquier.xyz>
	<qQjgSaFwOzw7iFfsrbo4dRn_AbfxhEl7kXpEXvsIrljGCkoocIcI_2N8vbcE85-6BgKF_C5rYPW8ZH_STh9UCmweG5kEboj64LOjElPOYRc=@pm.me>
	<Z2HZM9UW1iBmdHa8CmqW7YkHHAcOhUiWxZjBkEq3BJxKRW-S87bITtp9c2l-Al1IMoCNRXOmal3nH22UirhD0HKTVcLkWv__oVc4mXmHOoM=@pm.me>
	<AS-DklS9IbOb20QxukKOm4CjIYxptH5TpiJyiKF0zzW9wARr_PYFPFvqGPj-R-3LwcLGXGIIr4bvTXYQ1YCpR0B-y7SyQhn9yvFQZC6ldgA=@pm.me>

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");


-- 
Gilles Darold
http://www.darold.net/







view thread (29+ messages)  latest in thread

Message-ID: <3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net>
Permalink:  ../3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net/
Also on:    postgresql.org/message-id/3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: gilles@darold.net, gkokolatos@pm.me, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Introduce pg_receivewal gzip compression tests
  In-Reply-To: <3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox