1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +03:00

Set application_name per-test in isolation and ecpg tests.

Commit a4327296d taught pg_regress proper to do this, but
missed the opportunity to do likewise in the isolationtester
and ecpg variants of pg_regress.  Seems like this might be
helpful for tracking down issues exposed by those tests.
This commit is contained in:
Tom Lane
2019-08-27 19:49:09 -04:00
parent 458f01e254
commit b1907d6882
3 changed files with 19 additions and 0 deletions

View File

@@ -95,6 +95,7 @@ ecpg_start_test(const char *testname,
expectfile_source[MAXPGPATH];
char cmd[MAXPGPATH * 3];
char *testname_dash;
char *appnameenv;
snprintf(inprg, sizeof(inprg), "%s/%s", inputdir, testname);
@@ -144,6 +145,9 @@ ecpg_start_test(const char *testname,
outfile_stdout,
outfile_stderr);
appnameenv = psprintf("PGAPPNAME=ecpg/%s", testname_dash);
putenv(appnameenv);
pid = spawn_process(cmd);
if (pid == INVALID_PID)
@@ -153,6 +157,10 @@ ecpg_start_test(const char *testname,
exit(2);
}
unsetenv("PGAPPNAME");
free(appnameenv);
free(testname_dash);
free(outfile_stdout);
free(outfile_stderr);
free(outfile_source);