Skip to content

Commit 9903338

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 has 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. Author: Michael Paquier Reviewed-by: Asim Praveen, Melanie Plageman Discussion: https://postgr.es/m/20190819080820.GG18166@paquier.xyz
1 parent 292ae8a commit 9903338

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
static void run_testspec(TestSpec *testspec);
3835
static void run_all_permutations(TestSpec *testspec);
3936
static void run_all_permutations_recurse(TestSpec *testspec, int nsteps,
@@ -76,13 +73,10 @@ main(int argc, char **argv)
7673
int nallsteps;
7774
Step **allsteps;
7875

79-
while ((opt = getopt(argc, argv, "nV")) != -1)
76+
while ((opt = getopt(argc, argv, "V")) != -1)
8077
{
8178
switch (opt)
8279
{
83-
case 'n':
84-
dry_run = true;
85-
break;
8680
case 'V':
8781
puts("isolationtester (PostgreSQL) " PG_VERSION);
8882
exit(0);
@@ -144,16 +138,6 @@ main(int argc, char **argv)
144138
}
145139
}
146140

147-
/*
148-
* In dry-run mode, just print the permutations that would be run, and
149-
* exit.
150-
*/
151-
if (dry_run)
152-
{
153-
run_testspec(testspec);
154-
return 0;
155-
}
156-
157141
printf("Parsed test spec with %d sessions\n", testspec->nsessions);
158142

159143
/*
@@ -449,19 +433,6 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
449433
Step **waiting;
450434
Step **errorstep;
451435

452-
/*
453-
* In dry run mode, just display the permutation in the same format used
454-
* by spec files, and return.
455-
*/
456-
if (dry_run)
457-
{
458-
printf("permutation");
459-
for (i = 0; i < nsteps; i++)
460-
printf(" \"%s\"", steps[i]->name);
461-
printf("\n");
462-
return;
463-
}
464-
465436
waiting = pg_malloc(sizeof(Step *) * testspec->nsessions);
466437
errorstep = pg_malloc(sizeof(Step *) * testspec->nsessions);
467438

0 commit comments

Comments
 (0)