Skip to content

Commit 834cb72

Browse files
committed
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
1 parent 9cf1632 commit 834cb72

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/test/isolation/isolationtester.c

+1-30
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ static int *backend_pids = NULL;
3131
static const char **backend_pid_strs = NULL;
3232
static int nconns = 0;
3333

34-
/* In dry run only output permutations to be run by the tester. */
35-
static int dry_run = false;
36-
3734
/* Maximum time to wait before giving up on a step (in usec) */
3835
static int64 max_step_wait = 300 * USECS_PER_SEC;
3936

@@ -83,13 +80,10 @@ main(int argc, char **argv)
8380
int nallsteps;
8481
Step **allsteps;
8582

86-
while ((opt = getopt(argc, argv, "nV")) != -1)
83+
while ((opt = getopt(argc, argv, "V")) != -1)
8784
{
8885
switch (opt)
8986
{
90-
case 'n':
91-
dry_run = true;
92-
break;
9387
case 'V':
9488
puts("isolationtester (PostgreSQL) " PG_VERSION);
9589
exit(0);
@@ -159,16 +153,6 @@ main(int argc, char **argv)
159153
}
160154
}
161155

162-
/*
163-
* In dry-run mode, just print the permutations that would be run, and
164-
* exit.
165-
*/
166-
if (dry_run)
167-
{
168-
run_testspec(testspec);
169-
return 0;
170-
}
171-
172156
printf("Parsed test spec with %d sessions\n", testspec->nsessions);
173157

174158
/*
@@ -466,19 +450,6 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
466450
Step **waiting;
467451
Step **errorstep;
468452

469-
/*
470-
* In dry run mode, just display the permutation in the same format used
471-
* by spec files, and return.
472-
*/
473-
if (dry_run)
474-
{
475-
printf("permutation");
476-
for (i = 0; i < nsteps; i++)
477-
printf(" \"%s\"", steps[i]->name);
478-
printf("\n");
479-
return;
480-
}
481-
482453
waiting = pg_malloc(sizeof(Step *) * testspec->nsessions);
483454
errorstep = pg_malloc(sizeof(Step *) * testspec->nsessions);
484455

0 commit comments

Comments
 (0)