Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a8f6879

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 17d962c commit a8f6879

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/test/isolation/isolationtester.c

Lines changed: 1 addition & 30 deletions
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

@@ -81,13 +78,10 @@ main(int argc, char **argv)
8178
int nallsteps;
8279
Step **allsteps;
8380

84-
while ((opt = getopt(argc, argv, "nV")) != -1)
81+
while ((opt = getopt(argc, argv, "V")) != -1)
8582
{
8683
switch (opt)
8784
{
88-
case 'n':
89-
dry_run = true;
90-
break;
9185
case 'V':
9286
puts("isolationtester (PostgreSQL) " PG_VERSION);
9387
exit(0);
@@ -157,16 +151,6 @@ main(int argc, char **argv)
157151
}
158152
}
159153

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

172156
/*
@@ -462,19 +446,6 @@ run_permutation(TestSpec *testspec, int nsteps, Step **steps)
462446
Step **waiting;
463447
Step **errorstep;
464448

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

0 commit comments

Comments
 (0)