Re: Cirrus-ci is lowering free CI cycles - what to do with cfbot, etc?
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>,
Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Thomas Munro <thomas.munro@gmail.com>,
Justin Pryzby <pryzby@telsasoft.com>,
Nazir Bilal Yavuz <byavuz81@gmail.com>
Date: 2023-08-28T12:32:24Z
Lists: pgsql-hackers
Attachments
- v1-0001-Speed-up-pg_regress-server-testing.patch (application/octet-stream) patch v1-0001
- (unnamed) (text/plain)
> On 23 Aug 2023, at 23:12, Daniel Gustafsson <daniel@yesql.se> wrote: > >> On 23 Aug 2023, at 23:02, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> >> Daniel Gustafsson <daniel@yesql.se> writes: >>> On 23 Aug 2023, at 21:22, Andres Freund <andres@anarazel.de> wrote: >>>> I think there's more effective ways to make this cheaper. The basic thing >>>> would be to use libpq instead of forking of psql to make a connection >>>> check. >> >>> I had it in my head that not using libpq in pg_regress was a deliberate choice, >>> but I fail to find a reference to it in the archives. >> >> I have a vague feeling that you are right about that. Perhaps the >> concern was that under "make installcheck", pg_regress might be >> using a build-tree copy of libpq rather than the one from the >> system under test. As long as we're just trying to ping the server, >> that shouldn't matter too much I think ... unless we hit problems >> with, say, a different default port number or socket path compiled into >> one copy vs. the other? That seems like it's probably a "so don't >> do that" case, though. > > Ah yes, that does ring a familiar bell. I agree that using it for pinging the > server should be safe either way, but we should document the use-with-caution > in pg_regress.c if/when we go down that path. I'll take a stab at changing the > psql retry loop for pinging tomorrow to see what it would look like. Attached is a patch with a quick PoC for using PQPing instead of using psql for connection checks in pg_regress. In order to see performance it also includes a diag output for "Time to first test" which contains all setup costs. This might not make it into a commit but it was quite helpful in hacking so I left it in for now. The patch incorporates Andres' idea for finer granularity of checks by checking TICKS times per second rather than once per second, it also shifts the pg_usleep around to require just one ping in most cases compard to two today. On my relatively tired laptop this speeds up pg_regress setup with 100+ms with much bigger wins on Windows in the CI. While it does add a dependency on libpq, I think it's a fairly decent price to pay for running tests faster. -- Daniel Gustafsson
Commits
-
Use snprintf instead of sprintf in pg_regress.
- 8f0fd47fa337 17.0 landed
-
Speed up pg_regress server readiness testing.
- 66d6086cbcbf 17.0 landed
-
ci: Make compute resources for CI configurable
- e4693c68a497 15.5 landed
- e8a8cd05d4b9 16.0 landed
- a28166df8c5a 17.0 landed
-
ci: Prepare to make compute resources for CI configurable
- 284465e1b95e 15.5 landed
- 9ed46c78a362 16.0 landed
- 19cc96503d23 17.0 landed
-
ci: Use VMs for SanityCheck and CompilerWarnings
- 4fdfd0629d77 15.5 landed
- f518c909ead1 16.0 landed
- b2c91d841f1f 17.0 landed
-
ci: Move execution method of tasks into yaml templates
- 462f4df0a86d 15.5 landed
- cad461b044b5 16.0 landed
- 119ee6ab1b00 17.0 landed
-
ci: Don't specify amount of memory
- 89daa5ae307a 15.5 landed
- 5581a9a39530 16.0 landed
- 794e14e219c7 17.0 landed
-
ci: macos: Remove use of -Dsegsize_blocks=6
- 2243ef8dd6fb 16.0 landed
- 3d8d217450a6 17.0 landed
-
ci: macos: Remove use of -DRANDOMIZE_ALLOCATED_MEMORY
- 4bec616f26f5 16.0 landed
- 17ebbdf7de19 17.0 landed