Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pyU3D-00077D-8x for pgsql-hackers@arkaria.postgresql.org; Mon, 15 May 2023 08:59:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pyU3C-0000M9-44 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 May 2023 08:59:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pyU3B-0000M0-P1 for pgsql-hackers@lists.postgresql.org; Mon, 15 May 2023 08:59:25 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pyU38-002qP7-Od for pgsql-hackers@postgresql.org; Mon, 15 May 2023 08:59:25 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id EA97E2F75F67 for ; Mon, 15 May 2023 10:59:21 +0200 (CEST) Received: from s981.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id DB7B92E29ECE; Mon, 15 May 2023 10:59:21 +0200 (CEST) Received: from s472.loopia.se (unknown [172.22.191.5]) by s981.loopia.se (Postfix) with ESMTP id D81CE22B16B1; Mon, 15 May 2023 10:59:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s979.loopia.se ([172.22.191.5]) by s472.loopia.se (s472.loopia.se [172.22.190.12]) (amavisd-new, port 10024) with UTF8LMTP id 4J8D30R6PT3C; Mon, 15 May 2023 10:59:21 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s979.loopia.se (Postfix) with ESMTPSA id 1861A10BC4CC; Mon, 15 May 2023 10:59:21 +0200 (CEST) From: Daniel Gustafsson Message-Id: <0134C9EC-5F6B-4EAC-B2D5-BB4249BEBD4D@yesql.se> Content-Type: multipart/mixed; boundary="Apple-Mail=_77484405-97AC-455D-B861-6725E6019A2B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: pgsql: Clean up role created in new subscription test. Date: Mon, 15 May 2023 10:59:20 +0200 In-Reply-To: <284965.1680208176@sss.pgh.pa.us> Cc: Robert Haas , PostgreSQL Hackers To: Tom Lane References: <267900.1680201870@sss.pgh.pa.us> <99112997-6732-42C7-989B-06406C911FE2@yesql.se> <284965.1680208176@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3696.120.41.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_77484405-97AC-455D-B861-6725E6019A2B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 30 Mar 2023, at 22:29, Tom Lane wrote: > Well, we could do "select rolname from pg_roles order by 1" and > actually compare the results of the two selects. That might be > advisable anyway, in order to produce a complaint with useful > detail when there is something wrong. I took a look at this and came up with the attached. This adds a new = parameter to pg_regress for specifying a test which will be executed before and = after the suite, where the first invocation creates the expectfile for the second. = For storing the expecfile the temp dir creation is somewhat refactored. = I've added a sample test in the patch (to regress, not ECPG), but I'm sure it can = be expanded to be a bit more interesting. The comment which is now = incorrectly formatted was left like that to make review easier, if this gets = committed it will be fixed then. I opted for this to use the machinery that pg_regress already has rather = than add a new mechanism (and dependency) for running and verifying queries. = This also avoids hardcoding the test making it easier to have custom queries = during hacking etc. Looking at this I also found a bug introduced in the TAP format patch, = which made failed single run tests report as 0ms due to the parameters being = mixed up in the report function call. This is in 0002, which I'll apply to HEAD regardless of 0001 as they are unrelated. -- Daniel Gustafsson --Apple-Mail=_77484405-97AC-455D-B861-6725E6019A2B Content-Disposition: attachment; filename=v1-0002-pg_regress-Fix-reported-runtime-for-failed-single.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v1-0002-pg_regress-Fix-reported-runtime-for-failed-single.patch" Content-Transfer-Encoding: quoted-printable =46rom=20964f9baf8f5152529e0164cd7bbfafbab475b580=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Gustafsson=20= =0ADate:=20Mon,=2015=20May=202023=2010:45:18=20= +0200=0ASubject:=20[PATCH=20v1=202/2]=20pg_regress:=20Fix=20reported=20= runtime=20for=20failed=20single=0A=20tests=0A=0AThe=20order=20of=20= paramters=20to=20test_status_failed()=20was=20incorrect=20making=0A= failed=20single=20tests=20report=20a=20runtime=20of=200ms.=20Parallel=20= tests=20were=20not=0Aaffected.=0A---=0A=20src/test/regress/pg_regress.c=20= |=204=20++--=0A=201=20file=20changed,=202=20insertions(+),=202=20= deletions(-)=0A=0Adiff=20--git=20a/src/test/regress/pg_regress.c=20= b/src/test/regress/pg_regress.c=0Aindex=207a950b662d..ec6799a358=20= 100644=0A---=20a/src/test/regress/pg_regress.c=0A+++=20= b/src/test/regress/pg_regress.c=0A@@=20-1969,14=20+1969,14=20@@=20= run_single_test(const=20char=20*test,=20test_start_function=20startfunc,=0A= =20=0A=20=09if=20(exit_status=20!=3D=200)=0A=20=09{=0A-=09=09= test_status_failed(test,=20false,=20INSTR_TIME_GET_MILLISEC(stoptime));=0A= +=09=09test_status_failed(test,=20INSTR_TIME_GET_MILLISEC(stoptime),=20= false);=0A=20=09=09log_child_failure(exit_status);=0A=20=09}=0A=20=09= else=0A=20=09{=0A=20=09=09if=20(differ)=0A=20=09=09{=0A-=09=09=09= test_status_failed(test,=20false,=20INSTR_TIME_GET_MILLISEC(stoptime));=0A= +=09=09=09test_status_failed(test,=20INSTR_TIME_GET_MILLISEC(stoptime),=20= false);=0A=20=09=09}=0A=20=09=09else=0A=20=09=09{=0A--=20=0A2.32.1=20= (Apple=20Git-133)=0A=0A= --Apple-Mail=_77484405-97AC-455D-B861-6725E6019A2B Content-Disposition: attachment; filename=v1-0001-pg_regress-Add-database-verification-test.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v1-0001-pg_regress-Add-database-verification-test.patch" Content-Transfer-Encoding: quoted-printable =46rom=20af8f6f75e851256a8233e37ee9ac4e5018273191=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Gustafsson=20= =0ADate:=20Mon,=2015=20May=202023=2010:31:14=20= +0200=0ASubject:=20[PATCH=20v1=201/2]=20pg_regress:=20Add=20database=20= verification=20test=0A=0AThis=20adds=20a=20new=20parameter=20to=20= pg_regress=20for=20specifying=20a=20test=20which=0Ais=20used=20to=20= verify=20that=20the=20test=20suite=20didn't=20have=20side=20effects.=20= The=0Atest=20is=20executed=20before=20the=20testsuite,=20and=20the=20= resultsfile=20is=20saved=0Aas=20the=20expectfile=20for=20when=20the=20= test=20is=20re-run=20after=20the=20suite.=20=20The=0Aresults=20is=20then=20= diffed=20against=20the=20previously=20saved=20expectfile.=0A=0A= Discussion:=20https://postgr.es/m/267900.1680201870@sss.pgh.pa.us=0A---=0A= =20src/test/regress/GNUmakefile=20=20=20=20=20=20=20=20|=20=20=206=20+-=0A= =20src/test/regress/pg_regress.c=20=20=20=20=20=20=20|=20149=20= ++++++++++++++++++++++++----=0A=20src/test/regress/sql/sideeffect.sql=20= |=20=20=205=20+=0A=203=20files=20changed,=20136=20insertions(+),=2024=20= deletions(-)=0A=20create=20mode=20100644=20= src/test/regress/sql/sideeffect.sql=0A=0Adiff=20--git=20= a/src/test/regress/GNUmakefile=20b/src/test/regress/GNUmakefile=0Aindex=20= 38c3a1f85b..d6119dc9e5=20100644=0A---=20a/src/test/regress/GNUmakefile=0A= +++=20b/src/test/regress/GNUmakefile=0A@@=20-115,16=20+115,16=20@@=20= REGRESS_OPTS=20=3D=20--dlpath=3D.=20--max-concurrent-tests=3D20=20\=0A=20= =09$(EXTRA_REGRESS_OPTS)=0A=20=0A=20check:=20all=0A-=09= $(pg_regress_check)=20$(REGRESS_OPTS)=20= --schedule=3D$(srcdir)/parallel_schedule=20$(MAXCONNOPT)=20= $(EXTRA_TESTS)=0A+=09$(pg_regress_check)=20$(REGRESS_OPTS)=20= --verifydb=3Dsideeffect=20--schedule=3D$(srcdir)/parallel_schedule=20= $(MAXCONNOPT)=20$(EXTRA_TESTS)=0A=20=0A=20check-tests:=20all=20|=20= temp-install=0A=20=09$(pg_regress_check)=20$(REGRESS_OPTS)=20= $(MAXCONNOPT)=20$(TESTS)=20$(EXTRA_TESTS)=0A=20=0A=20installcheck:=20all=0A= -=09$(pg_regress_installcheck)=20$(REGRESS_OPTS)=20= --schedule=3D$(srcdir)/parallel_schedule=20--max-connections=3D1=20= $(EXTRA_TESTS)=0A+=09$(pg_regress_installcheck)=20$(REGRESS_OPTS)=20= --verifydb=3Dsideeffect=20--schedule=3D$(srcdir)/parallel_schedule=20= --max-connections=3D1=20$(EXTRA_TESTS)=0A=20=0A=20installcheck-parallel:=20= all=0A-=09$(pg_regress_installcheck)=20$(REGRESS_OPTS)=20= --schedule=3D$(srcdir)/parallel_schedule=20$(MAXCONNOPT)=20= $(EXTRA_TESTS)=0A+=09$(pg_regress_installcheck)=20$(REGRESS_OPTS)=20= --verifydb=3Dsideeffect=20--schedule=3D$(srcdir)/parallel_schedule=20= $(MAXCONNOPT)=20$(EXTRA_TESTS)=0A=20=0A=20installcheck-tests:=20all=0A=20= =09$(pg_regress_installcheck)=20$(REGRESS_OPTS)=20$(TESTS)=20= $(EXTRA_TESTS)=0Adiff=20--git=20a/src/test/regress/pg_regress.c=20= b/src/test/regress/pg_regress.c=0Aindex=2048008fa8c3..7a950b662d=20= 100644=0A---=20a/src/test/regress/pg_regress.c=0A+++=20= b/src/test/regress/pg_regress.c=0A@@=20-93,6=20+93,7=20@@=20bool=09=09= debug=20=3D=20false;=0A=20char=09=20=20=20*inputdir=20=3D=20".";=0A=20= char=09=20=20=20*outputdir=20=3D=20".";=0A=20char=20=20=20=20=20=20=20= *expecteddir=20=3D=20".";=0A+char=09=20=20=20*verifydb_test=20=3D=20= NULL;=0A=20char=09=20=20=20*bindir=20=3D=20PGBINDIR;=0A=20char=09=20=20=20= *launcher=20=3D=20NULL;=0A=20static=20_stringlist=20*loadextension=20=3D=20= NULL;=0A@@=20-112,6=20+113,7=20@@=20static=20char=20*dlpath=20=3D=20= PKGLIBDIR;=0A=20static=20char=20*user=20=3D=20NULL;=0A=20static=20= _stringlist=20*extraroles=20=3D=20NULL;=0A=20static=20char=20= *config_auth_datadir=20=3D=20NULL;=0A+static=20char=20*verifydb_expect=20= =3D=20NULL;=0A=20=0A=20/*=20internal=20variables=20*/=0A=20static=20= const=20char=20*progname;=0A@@=20-119,11=20+121,10=20@@=20static=20char=20= *logfilename;=0A=20static=20FILE=20*logfile;=0A=20static=20char=20= *difffilename;=0A=20static=20const=20char=20*sockdir;=0A-static=20const=20= char=20*temp_sockdir;=0A-static=20char=20sockself[MAXPGPATH];=0A-static=20= char=20socklock[MAXPGPATH];=0A+static=20const=20char=20*temp_dir=20=3D=20= NULL;=0A=20static=20StringInfo=20failed_tests=20=3D=20NULL;=0A=20static=20= bool=20in_note=20=3D=20false;=0A+static=20_stringlist=20*removefiles=20=3D= =20NULL;=0A=20=0A=20static=20_resultmap=20*resultmap=20=3D=20NULL;=0A=20=0A= @@=20-135,6=20+136,7=20@@=20static=20int=09fail_count=20=3D=200;=0A=20=0A= =20static=20bool=20directory_exists(const=20char=20*dir);=0A=20static=20= void=20make_directory(const=20char=20*dir);=0A+static=20void=20= run_verification(const=20char=20*test,=20test_start_function=20= startfunc,=20bool=20validate);=0A=20=0A=20static=20void=20= test_status_print(bool=20ok,=20const=20char=20*testname,=20double=20= runtime,=20bool=20parallel);=0A=20static=20void=20test_status_ok(const=20= char=20*testname,=20double=20runtime,=20bool=20parallel);=0A@@=20-435,7=20= +437,8=20@@=20stop_postmaster(void)=0A=20}=0A=20=0A=20/*=0A-=20*=20= Remove=20the=20socket=20temporary=20directory.=20=20pg_regress=20never=20= waits=20for=20a=0A+=20*=20Remove=20the=20temporary=20directory=20and=20= remove=20all=20files=20which=20have=20been=20added=0A+=20*=20to=20it.=20=20= pg_regress=20never=20waits=20for=20a=0A=20=20*=20postmaster=20exit,=20so=20= it=20is=20indeterminate=20whether=20the=20postmaster=20has=20yet=20to=0A=20= =20*=20unlink=20the=20socket=20and=20lock=20file.=20=20Unlink=20them=20= here=20so=20we=20can=20proceed=20to=0A=20=20*=20remove=20the=20= directory.=20=20Ignore=20errors;=20leaking=20a=20temporary=20directory=20= is=0A@@=20-446,10=20+449,15=20@@=20stop_postmaster(void)=0A=20static=20= void=0A=20remove_temp(void)=0A=20{=0A-=09Assert(temp_sockdir);=0A-=09= unlink(sockself);=0A-=09unlink(socklock);=0A-=09rmdir(temp_sockdir);=0A+=09= _stringlist=20*rf;=0A+=0A+=09Assert(temp_dir);=0A+=0A+=09/*=20Remove=20= any=20files=20which=20has=20been=20added=20to=20the=20temporary=20= directory=20*/=0A+=09for=20(rf=20=3D=20removefiles;=20rf=20!=3D=20NULL;=20= rf=20=3D=20rf->next)=0A+=09=09unlink(rf->str);=0A+=0A+=09= rmdir(temp_dir);=0A=20}=0A=20=0A=20/*=0A@@=20-465,7=20+473,9=20@@=20= signal_remove_temp(SIGNAL_ARGS)=0A=20}=0A=20=0A=20/*=0A-=20*=20Create=20= a=20temporary=20directory=20suitable=20for=20the=20server's=20= Unix-domain=20socket.=0A+=20*=20Create=20a=20temporary=20directory=20= suitable=20for=20the=20server's=20Unix-domain=20socket=0A+=20*=20as=20= well=20as=20any=20intermediate=20expectfiles.=0A+=20*=0A=20=20*=20The=20= directory=20will=20have=20mode=200700=20or=20stricter,=20so=20no=20other=20= OS=20user=20can=20open=0A=20=20*=20our=20socket=20to=20exploit=20our=20= use=20of=20trust=20authentication.=20=20Most=20systems=0A=20=20*=20= constrain=20the=20length=20of=20socket=20paths=20well=20below=20= _POSIX_PATH_MAX,=20so=20we=0A@@=20-477,22=20+487,23=20@@=20= signal_remove_temp(SIGNAL_ARGS)=0A=20=20*=20the=20build/test=20user.=0A=20= =20*/=0A=20static=20const=20char=20*=0A-make_temp_sockdir(void)=0A= +make_temp_dir(void)=0A=20{=0A-=09char=09=20=20=20*template=20=3D=20= psprintf("%s/pg_regress-XXXXXX",=0A-=09=09=09=09=09=09=09=09=09= getenv("TMPDIR")=20?=20getenv("TMPDIR")=20:=20"/tmp");=0A+=09char=09=20=20= =20*template;=0A=20=0A-=09temp_sockdir=20=3D=20mkdtemp(template);=0A-=09= if=20(temp_sockdir=20=3D=3D=20NULL)=0A+=09if=20(temp_dir=20!=3D=20NULL)=0A= +=09=09return=20temp_dir;=0A+=0A+=09template=20=3D=20= psprintf("%s/pg_regress-XXXXXX",=0A+=09=09=09=09=09=09getenv("TMPDIR")=20= ?=20getenv("TMPDIR")=20:=20"/tmp");=0A+=0A+=09temp_dir=20=3D=20= mkdtemp(template);=0A+=09if=20(temp_dir=20=3D=3D=20NULL)=0A=20=09{=0A-=09= =09bail("could=20not=20create=20directory=20\"%s\":=20%s",=0A+=09=09= bail("could=20not=20create=20temporary=20directory=20\"%s\":=20%s",=0A=20= =09=09=09=20template,=20strerror(errno));=0A=20=09}=0A=20=0A-=09/*=20= Stage=20file=20names=20for=20remove_temp().=20=20Unsafe=20in=20a=20= signal=20handler.=20*/=0A-=09UNIXSOCK_PATH(sockself,=20port,=20= temp_sockdir);=0A-=09snprintf(socklock,=20sizeof(socklock),=20"%s.lock",=20= sockself);=0A-=0A=20=09/*=20Remove=20the=20directory=20during=20clean=20= exit.=20*/=0A=20=09atexit(remove_temp);=0A=20=0A@@=20-505,7=20+516,7=20= @@=20make_temp_sockdir(void)=0A=20=09pqsignal(SIGPIPE,=20= signal_remove_temp);=0A=20=09pqsignal(SIGTERM,=20signal_remove_temp);=0A=20= =0A-=09return=20temp_sockdir;=0A+=09return=20temp_dir;=0A=20}=0A=20=0A=20= /*=0A@@=20-828,7=20+839,20=20@@=20initialize_environment(void)=0A=20=09=09= {=0A=20=09=09=09sockdir=20=3D=20getenv("PG_REGRESS_SOCK_DIR");=0A=20=09=09= =09if=20(!sockdir)=0A-=09=09=09=09sockdir=20=3D=20make_temp_sockdir();=0A= +=09=09=09{=0A+=09=09=09=09char=20sockself[MAXPGPATH];=0A+=09=09=09=09= char=20socklock[MAXPGPATH];=0A+=0A+=09=09=09=09sockdir=20=3D=20= make_temp_dir();=0A+=09=09=09=09/*=0A+=09=09=09=09=20*=20Stage=20socket=20= file=20names=20for=20remove_temp().=20=20Unsafe=20in=20a=0A+=09=09=09=09=20= *=20signal=20handler.=0A+=09=09=09=09=20*/=0A+=09=09=09=09= UNIXSOCK_PATH(sockself,=20port,=20temp_dir);=0A+=09=09=09=09= snprintf(socklock,=20sizeof(socklock),=20"%s.lock",=20sockself);=0A+=09=09= =09=09add_stringlist_item(&removefiles,=20sockself);=0A+=09=09=09=09= add_stringlist_item(&removefiles,=20socklock);=0A+=09=09=09}=0A=20=09=09=09= setenv("PGHOST",=20sockdir,=201);=0A=20=09=09}=0A=20=09=09= unsetenv("PGHOSTADDR");=0A@@=20-1840,6=20+1864,60=20@@=20= run_schedule(const=20char=20*schedule,=20test_start_function=20= startfunc,=0A=20=09fclose(scf);=0A=20}=0A=20=0A+/*=0A+=20*=20Run=20the=20= database=20verification=20test.=20Database=20validation=20tests=20are=20= intended=0A+=20*=20to=20be=20used=20for=20validating=20that=20the=20= testsuite=20doesn't=20modify=20the=20database.=0A+=20*=20When=20validate=20= is=20set=20to=20false,=20the=20test=20results=20are=20not=20validated=20= but=20are=0A+=20*=20saved=20to=20a=20temporary=20folder=20to=20be=20used=20= as=20a=20future=20expectfile.=20When=20validate=0A+=20*=20is=20set=20to=20= true=20the=20test=20results=20are=20validated=20against=20the=20= previously=20stored=0A+=20*=20expectfile.=0A+=20*/=0A+static=20void=0A= +run_verification(const=20char=20*test,=20test_start_function=20= startfunc,=20bool=20validate)=0A+{=0A+=09PID_TYPE=09pid;=0A+=09= instr_time=09starttime;=0A+=09instr_time=09stoptime;=0A+=09int=20=09=09= exit_status;=0A+=09_stringlist=20*resultfiles=20=3D=20NULL;=0A+=09= _stringlist=20*expectfiles=20=3D=20NULL;=0A+=09_stringlist=20*tags=20=3D=20= NULL;=0A+=0A+=09pid=20=3D=20(startfunc)=20(test,=20&resultfiles,=20= &expectfiles,=20&tags);=0A+=09INSTR_TIME_SET_CURRENT(starttime);=0A+=09= wait_for_tests(&pid,=20&exit_status,=20&stoptime,=20NULL,=201);=0A+=0A+=09= if=20(exit_status=20!=3D=200)=0A+=09{=0A+=09=09test_status_failed(test,=20= INSTR_TIME_GET_MILLISEC(stoptime),=20false);=0A+=09=09= log_child_failure(exit_status);=0A+=09}=0A+=0A+=09/*=0A+=09=20*=20Save=20= the=20resultfile=20as=20the=20expectfile=20for=20the=20next=20invocation=20= after=20the=0A+=09=20*=20the=20testsuite=20has=20finished.=0A+=09=20*/=0A= +=09if=20(!validate)=0A+=09{=0A+=09=09errno=20=3D=200;=0A+=09=09if=20= (rename(resultfiles[0].str,=20verifydb_expect)=20!=3D=200)=0A+=09=09=09= bail("could=20not=20write=20temporary=20expectfile=20\"%s\":=20%s",=0A+=09= =09=09=09=20verifydb_expect,=20strerror(errno));=0A+=09=09return;=0A+=09= }=0A+=0A+=09INSTR_TIME_SUBTRACT(stoptime,=20starttime);=0A+=0A+=09/*=0A+=09= =20*=20When=20executed=20after=20the=20testsuite=20we=20validate=20the=20= results=20against=20the=0A+=09=20*=20resultfile=20from=20the=20initial=20= run,=20whcih=20has=20been=20saved=20as=20an=20expectfile.=0A+=09=20*/=0A= +=09if=20(results_differ(test,=20resultfiles[0].str,=20verifydb_expect))=0A= +=09=09test_status_failed(test,=20INSTR_TIME_GET_MILLISEC(stoptime),=20= false);=0A+=09else=0A+=09=09test_status_ok(test,=20= INSTR_TIME_GET_MILLISEC(stoptime),=20false);=0A+}=0A+=0A=20/*=0A=20=20*=20= Run=20a=20single=20test=0A=20=20*/=0A@@=20-2049,6=20+2127,7=20@@=20= help(void)=0A=20=09printf(_("=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(can=20be=20used=20= multiple=20times=20to=20concatenate)\n"));=0A=20=09printf(_("=20=20=20=20= =20=20--temp-instance=3DDIR=20=20=20=20=20=20=20create=20a=20temporary=20= instance=20in=20DIR\n"));=0A=20=09printf(_("=20=20=20=20=20=20= --use-existing=20=20=20=20=20=20=20=20=20=20=20=20use=20an=20existing=20= installation\n"));=0A+=09printf(_("=20=20=20=20=20=20--verifydb=3DTEST=20= =20=20=20=20=20=20=20=20=20=20run=20TEST=20before=20and=20after=20and=20= ensure=20output=20matches\n"));=0A=20=09printf(_("=20=20-V,=20--version=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20output=20version=20= information,=20then=20exit\n"));=0A=20=09printf(_("\n"));=0A=20=09= printf(_("Options=20for=20\"temp-instance\"=20mode:\n"));=0A@@=20-2099,6=20= +2178,7=20@@=20regression_main(int=20argc,=20char=20*argv[],=0A=20=09=09= {"config-auth",=20required_argument,=20NULL,=2024},=0A=20=09=09= {"max-concurrent-tests",=20required_argument,=20NULL,=2025},=0A=20=09=09= {"expecteddir",=20required_argument,=20NULL,=2026},=0A+=09=09= {"verifydb",=20required_argument,=20NULL,=2027},=0A=20=09=09{NULL,=200,=20= NULL,=200}=0A=20=09};=0A=20=0A@@=20-2228,6=20+2308,9=20@@=20= regression_main(int=20argc,=20char=20*argv[],=0A=20=09=09=09case=2026:=0A= =20=09=09=09=09expecteddir=20=3D=20pg_strdup(optarg);=0A=20=09=09=09=09= break;=0A+=09=09=09case=2027:=0A+=09=09=09=09verifydb_test=20=3D=20= pg_strdup(optarg);=0A+=09=09=09=09break;=0A=20=09=09=09default:=0A=20=09=09= =09=09/*=20getopt_long=20already=20emitted=20a=20complaint=20*/=0A=20=09=09= =09=09pg_log_error_hint("Try=20\"%s=20--help\"=20for=20more=20= information.",=0A@@=20-2535,6=20+2618,21=20@@=20regression_main(int=20= argc,=20char=20*argv[],=0A=20=09=09=09create_role(sl->str,=20dblist);=0A=20= =09}=0A=20=0A+=09/*=0A+=09=20*=20If=20there=20is=20database=20= verification=20test,=20make=20sure=20to=20run=20it=20after=20we=0A+=09=20= *=20set=20up=20extra=20databases=20and=20roles,=20but=20before=20any=20= test=20has=20been=20run.=20A=0A+=09=20*=20temporary=20expectdir=20also=20= needs=20to=20be=20set=20up=20for=20this=20test=20since=20the=0A+=09=20*=20= outputfile=20from=20this=20test=20will=20be=20the=20expected=20file=20= for=20when=20we=20run=20it=0A+=09=20*=20again=20after=20the=20test(s).=0A= +=09=20*/=0A+=09if=20(verifydb_test)=0A+=09{=0A+=09=09make_temp_dir();=0A= +=09=09verifydb_expect=20=3D=20psprintf("%s/%s.sql",=20temp_dir,=20= verifydb_test);=0A+=09=09add_stringlist_item(&removefiles,=20= verifydb_expect);=0A+=09=09run_verification(verifydb_test,=20startfunc,=20= false);=0A+=09}=0A+=0A=20=09/*=0A=20=09=20*=20Ready=20to=20run=20the=20= tests=0A=20=09=20*/=0A@@=20-2548,6=20+2646,15=20@@=20regression_main(int=20= argc,=20char=20*argv[],=0A=20=09=09run_single_test(sl->str,=20startfunc,=20= postfunc);=0A=20=09}=0A=20=0A+=09/*=0A+=09=20*=20Run=20the=20= verification=20test=20again=20and=20compare=20the=20results=20with=20the=20= saved=0A+=09=20*=20results=20from=20before.=0A+=09=20*/=0A+=09if=20= (verifydb_test)=0A+=09{=0A+=09=09run_verification(verifydb_test,=20= startfunc,=20true);=0A+=09}=0A+=0A=20=09/*=0A=20=09=20*=20Shut=20down=20= temp=20installation's=20postmaster=0A=20=09=20*/=0Adiff=20--git=20= a/src/test/regress/sql/sideeffect.sql=20= b/src/test/regress/sql/sideeffect.sql=0Anew=20file=20mode=20100644=0A= index=200000000000..4726a2bc8c=0A---=20/dev/null=0A+++=20= b/src/test/regress/sql/sideeffect.sql=0A@@=20-0,0=20+1,5=20@@=0A+--=20= Queries=20to=20ensure=20no=20sideeffects=20from=20the=20regress=20suite.=20= This=20test=20does=20not=0A+--=20have=20a=20corresponding=20expectfile=20= stored.=0A+SELECT=20rolname=20FROM=20pg_roles=20ORDER=20BY=201;=0A= +SELECT=20spcname=20FROM=20pg_tablespace=20ORDER=20BY=201;=0A+SELECT=20= subname=20FROM=20pg_subscription=20ORDER=20BY=201;=0A--=20=0A2.32.1=20= (Apple=20Git-133)=0A=0A= --Apple-Mail=_77484405-97AC-455D-B861-6725E6019A2B--