Re-stabilize infinite_recurse() test case.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Apr 2020 16:00:37 +0000 (12:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 6 Apr 2020 16:00:37 +0000 (12:00 -0400)
Since commit 8f59f6b9c0, CLOBBER_CACHE_ALWAYS buildfarm members have
been failing this test case because the error message now sometimes
includes an error cursor position.  It seems largely just luck that
that never happened before, and there are likely to be more ways it
could happen in future.  Hence, rather than trying to prevent it,
adjust the test script to suppress that component of the report.

At some point we might need to back-patch this, but refrain until
there's a demonstrated need.  (We'd need a different fix before v12,
anyway, since VERBOSITY=sqlstate is a recent thing.)

Tom Lane and Andres Freund

Discussion: https://postgr.es/m/30675.1586111599@sss.pgh.pa.us

src/test/regress/expected/errors.out
src/test/regress/sql/errors.sql

index 7dd8a5b33e42dda094b4027ae585795ce1b7e935..a525aa2f93778cf66c0ca675ee0dd2f864a7a72c 100644 (file)
@@ -441,9 +441,12 @@ ERROR:  syntax error at or near "NUL"
 LINE 16: ...L, id2 TEXT NOT NULL PRIMARY KEY, id3 INTEGER NOT NUL, id4 I...
                                                               ^
 -- Check that stack depth detection mechanism works and
--- max_stack_depth is not set too high
+-- max_stack_depth is not set too high.  The full error report is not
+-- very stable, so show only SQLSTATE and primary error message.
 create function infinite_recurse() returns int as
 'select infinite_recurse()' language sql;
-\set VERBOSITY terse
+\set VERBOSITY sqlstate
 select infinite_recurse();
-ERROR:  stack depth limit exceeded
+ERROR:  54001
+\echo :LAST_ERROR_MESSAGE
+stack depth limit exceeded
index 792c29c64b5649e289d82642bd7c021e961aeaaf..86b672538a17a5b75be8c8b00d12fee698a0822f 100644 (file)
@@ -366,8 +366,10 @@ NOT
 NULL);
 
 -- Check that stack depth detection mechanism works and
--- max_stack_depth is not set too high
+-- max_stack_depth is not set too high.  The full error report is not
+-- very stable, so show only SQLSTATE and primary error message.
 create function infinite_recurse() returns int as
 'select infinite_recurse()' language sql;
-\set VERBOSITY terse
+\set VERBOSITY sqlstate
 select infinite_recurse();
+\echo :LAST_ERROR_MESSAGE