Re: Improving testing speed

"John P. Rouillard" <[email protected]> Fri, 11 Feb 2022 16:20:14 -0500
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi Mathias:

In message <[email protected]>,
Mathias Behrle writes:
>* John P. Rouillard: " [Roundup-devel] Improving testing speed" (Wed, 09 Feb
>  2022 20:54:24 -0500):
>JFTR you probably know about the following facts.
>
>For testing purposes you can also use settings that are dangerous on
>productionlike
>
>synchronous_commit = off        # synchronization level;
>fsync = off             # turns forced synchronization on or off

Hmm, yeah probably should look at fsync. I already switched
synchronous_commit off. I originally increased commit_delay to try to
coalesce multiple transactions as I wasn't sure how transactions were
handled by the underlying roundup backend routines.

>Probably you did already search for things like
>https://stackoverflow.com/questions/9407442/optimise-postgresql-for-fast-testing

That one was looking at truncate which I don't use. But wrapping
things in a transaction sped up operations for his test case.  Sadly I
don't see how to explicitly manage transactions from the testing code
as part's of the setup calls into roundup's backend code. Trying to
managing transactions explicitly from the test level could interfere
with backend code expectations 8-(.

Hence the though to bypass all the actual setup code by cloning a
properly setup database.

>and test database caching
>https://github.com/tk0miya/testing.postgresql

This looks like it iits an entirely new database instance. In my case
I have a pre-existing database server instance and just
drop/create/load a database.  It might be faster if I had the extra
memory and could use a RAM disk.

>or reusable containers.

I am not using containers, I run the tests on a small memory
constrained system running local postgres. Running the whole test
suite in CI takes 12 minutes. Running just the postgres test cases on
my box takes hours.

Thanks for the ideas though. fsync=off might help.

Have a great weekend.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.