Re: pgsql: Add basic TAP tests for psql's tab-completion logic.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Robert Haas <robertmhaas@gmail.com>, Christoph Berg <myon@debian.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-01-04T19:58:58Z
Lists: pgsql-hackers
I wrote:
> Seeing that you're also having issues with a stack involving
> libtinfo.so.5, here's my theory: libtinfo version 5 is brain-dead
> about whether it needs to issue cursor repositioning commands, and
> tends to do so even when the cursor is in the right place already.
> Version 6 fixed that, which is why we're not seeing these escape
> sequences on any of the libedit-using buildfarm critters.

Nope, the buildfarm just blew up that theory: Andres' critters are
failing in the wake of fac1c04fe, with symptoms exactly like those
of my franken-libedit build.  So newer libtinfo doesn't fix it.

What has to have broken those machines was the change to explicitly
force TERM to "xterm".  Now I'm wondering what their prevailing
setting was before that.  Maybe it was undef, or some absolutely
vanilla thing that prevents libtinfo from thinking it can use any
escape sequences at all.  I'm going to go find out, because if we
can use that behavior globally, it'd be a heck of a lot safer
solution than the path of dealing with escape sequences explicitly.

			regards, tom lane



Commits

  1. Skip tab-completion tests if envar SKIP_READLINE_TESTS is defined.

  2. Minor style improvements for tab-completion test.

  3. Avoid reading ~/.inputrc in tab-completion test, and revert other changes.

  4. Don't try to force TERM to a fixed value in tab-completion test.

  5. In tab-completion test, print out the value of TERM before changing it.

  6. Make tab-completion tests more robust.

  7. Further fixes for tab-completion TAP tests.

  8. Add an ugly workaround for a bug in some recent libedit versions.

  9. Add basic TAP tests for psql's tab-completion logic.

  10. Fix running out of file descriptors for spill files.