mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-01 07:07:21 +02:00
Remove dry-run mode from isolationtester
The original purpose of the dry-run mode is to be able to print all the
possible permutations from a spec file, but it has become less useful
since isolation tests have improved regarding deadlock detection as one
step not wanted by the author could block indefinitely now (originally
the step blocked would have been detected rather quickly). Per
discussion, let's remove it.
This is a backpatch of 9903338
for 9.6~12. It is proving to become
useful to have on those branches so as the code gets consistent across
all supported versions, as a matter of improving the output generated by
isolationtester.
Author: Michael Paquier
Reviewed-by: Asim Praveen, Melanie Plageman
Discussion: https://postgr.es/m/20190819080820.GG18166@paquier.xyz
Discussion: https://postgr.es/m/794820.1623872009@sss.pgh.pa.us
Backpatch-through: 9.6
This commit is contained in:
parent
9cf1632660
commit
834cb72691
@ -31,9 +31,6 @@ static int *backend_pids = NULL;
|
|||||||
static const char **backend_pid_strs = NULL;
|
static const char **backend_pid_strs = NULL;
|
||||||
static int nconns = 0;
|
static int nconns = 0;
|
||||||
|
|
||||||
/* In dry run only output permutations to be run by the tester. */
|
|
||||||
static int dry_run = false;
|
|
||||||
|
|
||||||
/* Maximum time to wait before giving up on a step (in usec) */
|
/* Maximum time to wait before giving up on a step (in usec) */
|
||||||
static int64 max_step_wait = 300 * USECS_PER_SEC;
|
static int64 max_step_wait = 300 * USECS_PER_SEC;
|
||||||
|
|
||||||
@ -83,13 +80,10 @@ main(int argc, char **argv)
|
|||||||
int nallsteps;
|
int nallsteps;
|
||||||
Step **allsteps;
|
Step **allsteps;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "nV")) != -1)
|
while ((opt = getopt(argc, argv, "V")) != -1)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
case 'n':
|
|
||||||
dry_run = true;
|
|
||||||
break;
|
|
||||||
case 'V':
|
case 'V':
|
||||||
puts("isolationtester (PostgreSQL) " PG_VERSION);
|
puts("isolationtester (PostgreSQL) " PG_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -159,16 +153,6 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* In dry-run mode, just print the permutations that would be run, and
|
|
||||||
* exit.
|
|
||||||
*/
|
|
||||||
if (dry_run)
|
|
||||||
{
|
|
||||||
run_testspec(testspec);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Parsed test spec with %d sessions\n", testspec->nsessions);
|
printf("Parsed test spec with %d sessions\n", testspec->nsessions);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -466,19 +450,6 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
|
|||||||
Step **waiting;
|
Step **waiting;
|
||||||
Step **errorstep;
|
Step **errorstep;
|
||||||
|
|
||||||
/*
|
|
||||||
* In dry run mode, just display the permutation in the same format used
|
|
||||||
* by spec files, and return.
|
|
||||||
*/
|
|
||||||
if (dry_run)
|
|
||||||
{
|
|
||||||
printf("permutation");
|
|
||||||
for (i = 0; i < nsteps; i++)
|
|
||||||
printf(" \"%s\"", steps[i]->name);
|
|
||||||
printf("\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
waiting = pg_malloc(sizeof(Step *) * testspec->nsessions);
|
waiting = pg_malloc(sizeof(Step *) * testspec->nsessions);
|
||||||
errorstep = pg_malloc(sizeof(Step *) * testspec->nsessions);
|
errorstep = pg_malloc(sizeof(Step *) * testspec->nsessions);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user