Re: Unit tests for SLRU - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Unit tests for SLRU
Date
Msg-id CAJ7c6TN5sOrr9hZzVDrx0mNFFO=kbrM81jD=XgppTyM9eigUpw@mail.gmail.com
Whole thread Raw
In response to Re: Unit tests for SLRU  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Unit tests for SLRU  (Aleksander Alekseev <aleksander@timescale.com>)
List 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

pgsql-hackers by date:

Previous
From: "Gunnar \"Nick\" Bluth"
Date:
Subject: Re: PATCH: add "--config-file=" option to pg_rewind
Next
From: "wangw.fnst@fujitsu.com"
Date:
Subject: RE: Logical replication timeout problem