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

Commit c99c67f

Browse files
committed
Replace PGISOLATIONTIMEOUT with 2 * PG_TEST_TIMEOUT_DEFAULT.
Now that the more-generic variable exists, use it. Discussion: https://postgr.es/m/20220219024136.GA3670392@rfd.leadboat.com
1 parent 4f4c72c commit c99c67f

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/test/isolation/README

+8-7
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ pg_isolation_regress is a tool similar to pg_regress, but instead of using
4747
psql to execute a test, it uses isolationtester. It accepts all the same
4848
command-line arguments as pg_regress.
4949

50-
By default, isolationtester will wait at most 300 seconds (5 minutes)
50+
By default, isolationtester will wait at most 360 seconds (6 minutes)
5151
for any one test step to complete. If you need to adjust this, set
52-
the environment variable PGISOLATIONTIMEOUT to the desired timeout
53-
in seconds.
52+
the environment variable PG_TEST_TIMEOUT_DEFAULT to half the desired
53+
timeout in seconds.
5454

5555

5656
Test specification
@@ -138,10 +138,11 @@ Each step may contain commands that block until further action has been taken
138138
deadlock). A test that uses this ability must manually specify valid
139139
permutations, i.e. those that would not expect a blocked session to execute a
140140
command. If a test fails to follow that rule, isolationtester will cancel it
141-
after PGISOLATIONTIMEOUT seconds. If the cancel doesn't work, isolationtester
142-
will exit uncleanly after a total of twice PGISOLATIONTIMEOUT. Testing
143-
invalid permutations should be avoided because they can make the isolation
144-
tests take a very long time to run, and they serve no useful testing purpose.
141+
after 2 * PG_TEST_TIMEOUT_DEFAULT seconds. If the cancel doesn't work,
142+
isolationtester will exit uncleanly after a total of 4 *
143+
PG_TEST_TIMEOUT_DEFAULT. Testing invalid permutations should be avoided
144+
because they can make the isolation tests take a very long time to run, and
145+
they serve no useful testing purpose.
145146

146147
Note that isolationtester recognizes that a command has blocked by looking
147148
to see if it is shown as waiting in the pg_locks view; therefore, only

src/test/isolation/isolationtester.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static int nconns = 0;
4646
static bool any_new_notice = false;
4747

4848
/* Maximum time to wait before giving up on a step (in usec) */
49-
static int64 max_step_wait = 300 * USECS_PER_SEC;
49+
static int64 max_step_wait = 360 * USECS_PER_SEC;
5050

5151

5252
static void check_testspec(TestSpec *testspec);
@@ -128,12 +128,12 @@ main(int argc, char **argv)
128128
conninfo = "dbname = postgres";
129129

130130
/*
131-
* If PGISOLATIONTIMEOUT is set in the environment, adopt its value (given
132-
* in seconds) as the max time to wait for any one step to complete.
131+
* If PG_TEST_TIMEOUT_DEFAULT is set, adopt its value (given in seconds)
132+
* as half the max time to wait for any one step to complete.
133133
*/
134-
env_wait = getenv("PGISOLATIONTIMEOUT");
134+
env_wait = getenv("PG_TEST_TIMEOUT_DEFAULT");
135135
if (env_wait != NULL)
136-
max_step_wait = ((int64) atoi(env_wait)) * USECS_PER_SEC;
136+
max_step_wait = 2 * ((int64) atoi(env_wait)) * USECS_PER_SEC;
137137

138138
/* Read the test spec from stdin */
139139
spec_yyparse();

0 commit comments

Comments
 (0)