Skip to content

Commit 89b6a19

Browse files
committed
In pg_regress, remove the temporary installation upon successful exit.
This results in a very substantial reduction in disk space usage during "make check-world", since that sequence involves creation of numerous temporary installations. It should also help a bit in the buildfarm, even though the buildfarm script doesn't create as many temp installations, because the current script misses deleting some of them; and anyway it seems better to do this once in one place rather than expecting that script to get it right every time. In 9.4 and HEAD, also undo the unwise choice in commit b1aebbb to report strerror(errno) after a rmtree() failure. rmtree has already reported that, possibly for multiple failures with distinct errnos; and what's more, by the time it returns there is no good reason to assume that errno still reflects the last reportable error. So reporting errno here is at best redundant and at worst badly misleading. Back-patch to all supported branches, so that future revisions of the buildfarm script can rely on this behavior.
1 parent 33b7235 commit 89b6a19

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/regress/pg_regress.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,6 +2673,19 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
26732673
stop_postmaster();
26742674
}
26752675

2676+
/*
2677+
* If there were no errors, remove the temp installation immediately to
2678+
* conserve disk space. (If there were errors, we leave the installation
2679+
* in place for possible manual investigation.)
2680+
*/
2681+
if (temp_install && fail_count == 0 && fail_ignore_count == 0)
2682+
{
2683+
header(_("removing temporary installation"));
2684+
if (!rmtree(temp_install, true))
2685+
fprintf(stderr, _("\n%s: could not remove temp installation \"%s\"\n"),
2686+
progname, temp_install);
2687+
}
2688+
26762689
fclose(logfile);
26772690

26782691
/*

0 commit comments

Comments
 (0)