1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Don't drop NOTICE messages in isolation tests.

For its entire existence, isolationtester.c has forced client_min_messages
to WARNING, but that seems like a very poor choice of test design.  It
should be up to individual test scripts to manage whether they emit notices
and to ensure that the results are stable.  (There were no NOTICE messages
in the original set of isolation tests, so this was certainly dead code
when committed, but perhaps it was needed at some earlier point.)

It's possible that the original motivation was due to platform-dependent
variations in the timing of stdout vs. stderr output.  That should be
moot since commits 73bcb76b7/6eda3e9c2, but just in case, adjust
isotesterNoticeProcessor to print to stdout not stderr.  (stderr seems
like the wrong thing anyway: it should be for error printouts not expected
test output.)

Back-patch of commit ebd499282 into v12.  I'll separately push this
into older branches, but this is as much change as v12 needs.

Discussion: https://postgr.es/m/14616.1564251339@sss.pgh.pa.us
Discussion: https://postgr.es/m/E1i7IqC-0000Uc-5H@gemulon.postgresql.org
This commit is contained in:
Tom Lane
2019-09-10 12:04:57 -04:00
parent 97fb88ea4a
commit b1016834d3
4 changed files with 54 additions and 23 deletions

View File

@@ -187,18 +187,6 @@ main(int argc, char **argv)
blackholeNoticeProcessor,
NULL);
/*
* Suppress NOTIFY messages, which otherwise pop into results at odd
* places.
*/
res = PQexec(conns[i], "SET client_min_messages = warning;");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "message level setup failed: %s", PQerrorMessage(conns[i]));
exit(1);
}
PQclear(res);
/* Get the backend pid for lock wait checking. */
res = PQexec(conns[i], "SELECT pg_catalog.pg_backend_pid()");
if (PQresultStatus(res) == PGRES_TUPLES_OK)
@@ -921,7 +909,7 @@ printResultSet(PGresult *res)
static void
isotesterNoticeProcessor(void *arg, const char *message)
{
fprintf(stderr, "%s: %s", (char *) arg, message);
printf("%s: %s", (char *) arg, message);
}
/* notice processor, hides the message */