Replace PGISOLATIONTIMEOUT with 2 * PG_TEST_TIMEOUT_DEFAULT.
authorNoah Misch <noah@leadboat.com>
Sat, 2 Jul 2022 01:27:50 +0000 (18:27 -0700)
committerNoah Misch <noah@leadboat.com>
Sat, 2 Jul 2022 01:27:50 +0000 (18:27 -0700)
Now that the more-generic variable exists, use it.

Discussion: https://postgr.es/m/20220219024136.GA3670392@rfd.leadboat.com

src/test/isolation/README
src/test/isolation/isolationtester.c

index 8457a5689fb36aba88cfdc85a0aff1aaf24189b3..5818ca50038eb2c8935a5df89969232752f8c705 100644 (file)
@@ -47,10 +47,10 @@ pg_isolation_regress is a tool similar to pg_regress, but instead of using
 psql to execute a test, it uses isolationtester.  It accepts all the same
 command-line arguments as pg_regress.
 
-By default, isolationtester will wait at most 300 seconds (5 minutes)
+By default, isolationtester will wait at most 360 seconds (6 minutes)
 for any one test step to complete.  If you need to adjust this, set
-the environment variable PGISOLATIONTIMEOUT to the desired timeout
-in seconds.
+the environment variable PG_TEST_TIMEOUT_DEFAULT to half the desired
+timeout in seconds.
 
 
 Test specification
@@ -138,10 +138,11 @@ Each step may contain commands that block until further action has been taken
 deadlock).  A test that uses this ability must manually specify valid
 permutations, i.e. those that would not expect a blocked session to execute a
 command.  If a test fails to follow that rule, isolationtester will cancel it
-after PGISOLATIONTIMEOUT seconds.  If the cancel doesn't work, isolationtester
-will exit uncleanly after a total of twice PGISOLATIONTIMEOUT.  Testing
-invalid permutations should be avoided because they can make the isolation
-tests take a very long time to run, and they serve no useful testing purpose.
+after 2 * PG_TEST_TIMEOUT_DEFAULT seconds.  If the cancel doesn't work,
+isolationtester will exit uncleanly after a total of 4 *
+PG_TEST_TIMEOUT_DEFAULT.  Testing invalid permutations should be avoided
+because they can make the isolation tests take a very long time to run, and
+they serve no useful testing purpose.
 
 Note that isolationtester recognizes that a command has blocked by looking
 to see if it is shown as waiting in the pg_locks view; therefore, only
index 12179f251469c8d8885106aa0c2bcb1a9979ad53..095db8f35c12a1402c591a7e1b04a4b384a1502d 100644 (file)
@@ -46,7 +46,7 @@ static int    nconns = 0;
 static bool any_new_notice = false;
 
 /* Maximum time to wait before giving up on a step (in usec) */
-static int64 max_step_wait = 300 * USECS_PER_SEC;
+static int64 max_step_wait = 360 * USECS_PER_SEC;
 
 
 static void check_testspec(TestSpec *testspec);
@@ -128,12 +128,12 @@ main(int argc, char **argv)
        conninfo = "dbname = postgres";
 
    /*
-    * If PGISOLATIONTIMEOUT is set in the environment, adopt its value (given
-    * in seconds) as the max time to wait for any one step to complete.
+    * If PG_TEST_TIMEOUT_DEFAULT is set, adopt its value (given in seconds)
+    * as half the max time to wait for any one step to complete.
     */
-   env_wait = getenv("PGISOLATIONTIMEOUT");
+   env_wait = getenv("PG_TEST_TIMEOUT_DEFAULT");
    if (env_wait != NULL)
-       max_step_wait = ((int64) atoi(env_wait)) * USECS_PER_SEC;
+       max_step_wait = 2 * ((int64) atoi(env_wait)) * USECS_PER_SEC;
 
    /* Read the test spec from stdin */
    spec_yyparse();