Skip to content

Commit b7cd5c5

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 c50596c commit b7cd5c5

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
@@ -34,9 +34,6 @@ static int *backend_pids = NULL;
3434
static const char **backend_pid_strs = NULL;
3535
static int nconns = 0;
3636

37-
/* In dry run only output permutations to be run by the tester. */
38-
static int dry_run = false;
39-
4037
/* Maximum time to wait before giving up on a step (in usec) */
4138
static int64 max_step_wait = 300 * USECS_PER_SEC;
4239

@@ -85,13 +82,10 @@ main(int argc, char **argv)
8582
int nallsteps;
8683
Step **allsteps;
8784

88-
while ((opt = getopt(argc, argv, "nV")) != -1)
85+
while ((opt = getopt(argc, argv, "V")) != -1)
8986
{
9087
switch (opt)
9188
{
92-
case 'n':
93-
dry_run = true;
94-
break;
9589
case 'V':
9690
puts("isolationtester (PostgreSQL) " PG_VERSION);
9791
exit(0);
@@ -161,16 +155,6 @@ main(int argc, char **argv)
161155
}
162156
}
163157

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

176160
/*
@@ -468,19 +452,6 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
468452
Step **waiting;
469453
Step **errorstep;
470454

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

0 commit comments

Comments
 (0)