Re: Introduce pg_receivewal gzip compression tests

Поиск
Список
Период
Сортировка
От Gilles Darold
Тема Re: Introduce pg_receivewal gzip compression tests
Дата
Msg-id 3543bfcd-e07e-129e-ff3c-5daf99aa182a@darold.net
обсуждение исходный текст
Ответ на Re: Introduce pg_receivewal gzip compression tests  (gkokolatos@pm.me)
Ответы Re: Introduce pg_receivewal gzip compression tests
Список pgsql-hackers
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/





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Teach pg_receivewal to use lz4 compression
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Introduce pg_receivewal gzip compression tests