Re: Unit tests for SLRU

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Maxim Orlov <orlovmg(at)gmail(dot)com>, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Unit tests for SLRU
Date: 2022-04-06 12:44:38
Message-ID: CAJ7c6TN5sOrr9hZzVDrx0mNFFO=kbrM81jD=XgppTyM9eigUpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

> OK, here is an updated version of the patch. Changes comparing to v1:
>
> * Tests are moved to regress.c, as asked by the majority;
> * SimpleLruInit() returns void as before, per Daniel's feedback;
> * Most of the initial refactorings were reverted in order to keep the patch
> as small as possible, per Maxim's feedback.

Here is version 3 of the patch.

Test coverage is 92.3% of functions, 73.4% of lines of code. Not all error
handling was covered, and I couldn't cover SimpleLruWaitIO(). The latest
requires writing a concurrent test, which from what I know is not exactly what
unit tests are for. We can make it public if we want to, but considering the
simplicity of the function and the existence of many other tests I didn't find
it necessary.

I think the tests are about as good as they will ever get.

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v3-0001-Unit-tests-for-SLRU.patch application/octet-stream 20.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wangw.fnst@fujitsu.com 2022-04-06 12:59:55 RE: Logical replication timeout problem
Previous Message Gunnar "Nick" Bluth 2022-04-06 12:32:44 Re: PATCH: add "--config-file=" option to pg_rewind