@@ -5,22 +5,27 @@ Isolation tests
5
5
6
6
This directory contains a set of tests for the serializable isolation level.
7
7
Testing isolation requires running multiple overlapping transactions,
8
- which requires multiple concurrent connections, and can't therefore be
8
+ which requires multiple concurrent connections, and therefore can't be
9
9
tested using the normal pg_regress program.
10
10
11
+ To run the tests, you need to have a server running at the default port
12
+ expected by libpq. (You can set PGPORT and so forth in your environment
13
+ to control this.) Then run
14
+ gmake installcheck
15
+ Note that the prepared-transactions test will not pass unless you have
16
+ the server's max_prepared_transactions parameter set to at least 3.
17
+
11
18
To represent a test with overlapping transactions, we use a test specification
12
- file with a custom syntax, described in the next section.
19
+ file with a custom syntax, which is described in the next section.
13
20
14
- isolationtester is program that uses libpq to open multiple connections,
21
+ isolationtester is a program that uses libpq to open multiple connections,
15
22
and executes a test specified by a spec file. A libpq connection string
16
23
specifies the server and database to connect to; defaults derived from
17
24
environment variables are used otherwise.
18
25
19
26
pg_isolation_regress is a tool similar to pg_regress, but instead of using
20
27
psql to execute a test, it uses isolationtester.
21
28
22
- To run the tests, you need to have a server up and running. Run
23
- gmake installcheck
24
29
25
30
Test specification
26
31
==================
@@ -63,3 +68,16 @@ permutation "<step name>" ...
63
68
all possible overlapping orderings of the given sessions.
64
69
65
70
Lines beginning with a # are considered comments.
71
+
72
+
73
+ Support for blocking commands
74
+ =============================
75
+
76
+ Each spec may contain commands that block until further action has been taken
77
+ (most likely, some other session runs a step that unblocks it or causes a
78
+ deadlock). Such a spec needs to be careful to manually specify valid
79
+ permutations, i.e. those that would not expect a blocked session to execute a
80
+ command. If the spec fails to follow that rule, the spec is aborted.
81
+
82
+ Only one command can be waiting at a time. As long as one command is waiting,
83
+ other commands are run to completion synchronously.
0 commit comments