Add an SSI regression test that tests all interesting permutations in the
order of begin, prepare, and commit of three concurrent transactions that have conflicts between them. The test runs for a quite long time, and the expected output file is huge, but this test caught some serious bugs during development, so seems worthwhile to keep. The test uses prepared transactions, so it fails if the server has max_prepared_transactions=0. Because of that, it's marked as "ignore" in the schedule file. Dan Ports
This commit is contained in:
parent
62fd1afc55
commit
af35737313
34843
src/test/isolation/expected/prepared-transactions.out
Normal file
34843
src/test/isolation/expected/prepared-transactions.out
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,11 @@ test: ri-trigger
|
|||||||
test: partial-index
|
test: partial-index
|
||||||
test: two-ids
|
test: two-ids
|
||||||
test: multiple-row-versions
|
test: multiple-row-versions
|
||||||
|
# Ignore failure from prepared-transactions test, because it fails if
|
||||||
|
# prepared transactions are disabled in the server. It should pass if they're
|
||||||
|
# enabled, however.
|
||||||
|
ignore: prepared-transactions
|
||||||
|
test: prepared-transactions
|
||||||
test: fk-contention
|
test: fk-contention
|
||||||
test: fk-deadlock
|
test: fk-deadlock
|
||||||
test: fk-deadlock2
|
test: fk-deadlock2
|
||||||
|
@ -416,7 +416,11 @@ run_permutation(TestSpec * testspec, int nsteps, Step ** steps)
|
|||||||
if (testspec->sessions[i]->setupsql)
|
if (testspec->sessions[i]->setupsql)
|
||||||
{
|
{
|
||||||
res = PQexec(conns[i + 1], testspec->sessions[i]->setupsql);
|
res = PQexec(conns[i + 1], testspec->sessions[i]->setupsql);
|
||||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
if (PQresultStatus(res) == PGRES_TUPLES_OK)
|
||||||
|
{
|
||||||
|
printResultSet(res);
|
||||||
|
}
|
||||||
|
else if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "setup of session %s failed: %s",
|
fprintf(stderr, "setup of session %s failed: %s",
|
||||||
testspec->sessions[i]->name,
|
testspec->sessions[i]->name,
|
||||||
@ -477,7 +481,11 @@ run_permutation(TestSpec * testspec, int nsteps, Step ** steps)
|
|||||||
if (testspec->teardownsql)
|
if (testspec->teardownsql)
|
||||||
{
|
{
|
||||||
res = PQexec(conns[0], testspec->teardownsql);
|
res = PQexec(conns[0], testspec->teardownsql);
|
||||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
if (PQresultStatus(res) == PGRES_TUPLES_OK)
|
||||||
|
{
|
||||||
|
printResultSet(res);
|
||||||
|
}
|
||||||
|
else if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "teardown failed: %s",
|
fprintf(stderr, "teardown failed: %s",
|
||||||
PQerrorMessage(conns[0]));
|
PQerrorMessage(conns[0]));
|
||||||
|
1507
src/test/isolation/specs/prepared-transactions.spec
Normal file
1507
src/test/isolation/specs/prepared-transactions.spec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user