Set different deadlock_timeout on each session in new isolation tests

This provides deterministic deadlock-detection ordering for new
isolation tests, fixing the sporadic failures in them.

Author: Noah Misch
This commit is contained in:
Alvaro Herrera 2011-07-15 18:43:33 -04:00
parent bf3c585681
commit d71197cd35
4 changed files with 10 additions and 10 deletions

View File

@ -32,8 +32,8 @@ step s1i: INSERT INTO child VALUES (1, 1);
step s2i: INSERT INTO child VALUES (2, 1);
step s2u: UPDATE parent SET aux = 'baz'; <waiting ...>
step s1u: UPDATE parent SET aux = 'bar';
step s2u: <... completed>
ERROR: deadlock detected
step s2u: <... completed>
step s2c: COMMIT;
step s1c: COMMIT;
@ -52,8 +52,8 @@ step s2i: INSERT INTO child VALUES (2, 1);
step s1i: INSERT INTO child VALUES (1, 1);
step s2u: UPDATE parent SET aux = 'baz'; <waiting ...>
step s1u: UPDATE parent SET aux = 'bar';
step s2u: <... completed>
ERROR: deadlock detected
step s2u: <... completed>
step s2c: COMMIT;
step s1c: COMMIT;

View File

@ -42,8 +42,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected
step s2u2: <... completed>
step s1c: COMMIT;
step s2c: COMMIT;
@ -52,8 +52,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected
step s2u2: <... completed>
step s2c: COMMIT;
step s1c: COMMIT;
@ -82,8 +82,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected
step s2u2: <... completed>
step s1c: COMMIT;
step s2c: COMMIT;
@ -92,8 +92,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected
step s2u2: <... completed>
step s2c: COMMIT;
step s1c: COMMIT;

View File

@ -19,13 +19,13 @@ teardown
}
session "s1"
setup { BEGIN; }
setup { BEGIN; SET deadlock_timeout = '20ms'; }
step "s1i" { INSERT INTO child VALUES (1, 1); }
step "s1u" { UPDATE parent SET aux = 'bar'; }
step "s1c" { COMMIT; }
session "s2"
setup { BEGIN; }
setup { BEGIN; SET deadlock_timeout = '10s'; }
step "s2i" { INSERT INTO child VALUES (2, 1); }
step "s2u" { UPDATE parent SET aux = 'baz'; }
step "s2c" { COMMIT; }

View File

@ -24,13 +24,13 @@ teardown
}
session "s1"
setup { BEGIN; }
setup { BEGIN; SET deadlock_timeout = '20ms'; }
step "s1u1" { UPDATE A SET Col1 = 1 WHERE AID = 1; }
step "s1u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s1c" { COMMIT; }
session "s2"
setup { BEGIN; }
setup { BEGIN; SET deadlock_timeout = '10s'; }
step "s2u1" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s2u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s2c" { COMMIT; }