One trouble I face when adding tests is that sometimes they require hooks in the code, to test for race conditions. In BRIN I cannot test some code paths without resorting to adding breakpoints in GDB, for instance. If there's no support for such in the core code, it's essentially impossible to add meaningful test for certain code paths. I toyed with the notion of adding hook points (such that a test module can put the backend to sleep until the other backend acknowledges hitting the race condition window); I decided not to because it seems a more general discussion is necessary first about the desirability of such.
As I recall we needed this in SKIP LOCKED and of course for multixacts also. I agree with the general idea that it's worthwhile to add lots more tests than we currently have, both for the current code and for future patches. Surely we don't need to reach the point where every single nuance of every single user interface is verified to the point that tests are such a large burden to maintain as is being suggested. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers