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

Commit caefc11

Browse files
committed
Further tweaking of deadlock isolation tests.
The new deadlock-soft-2 test has a timing dependency too: it supposes that isolationtester will detect step s1b as waiting before the deadlock detector runs and grants it the lock. Adjust deadlock_timeout to ensure that that's true even in CLOBBER_CACHE_ALWAYS builds, where the wait detection query is quite slow. Per buildfarm member jaguarundi.
1 parent f144f73 commit caefc11

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/test/isolation/specs/deadlock-soft-2.spec

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
# jump over both s3 and s4 and acquire the lock on a2 immediately,
33
# since s3 and s4 are hard-blocked on a1.
44

5+
# The expected output for this test assumes that isolationtester will
6+
# detect step s1b as waiting before the deadlock detector runs and
7+
# releases s1 from its blocked state. To leave enough time for that
8+
# to happen even in very slow (CLOBBER_CACHE_ALWAYS) cases, we must
9+
# increase deadlock_timeout.
10+
511
setup
612
{
713
CREATE TABLE a1 ();
@@ -14,24 +20,24 @@ teardown
1420
}
1521

1622
session "s1"
17-
setup { BEGIN; }
23+
setup { BEGIN; SET deadlock_timeout = '5s'; }
1824
step "s1a" { LOCK TABLE a1 IN SHARE UPDATE EXCLUSIVE MODE; }
1925
step "s1b" { LOCK TABLE a2 IN SHARE UPDATE EXCLUSIVE MODE; }
2026
step "s1c" { COMMIT; }
2127

2228
session "s2"
23-
setup { BEGIN; }
29+
setup { BEGIN; SET deadlock_timeout = '100s'; }
2430
step "s2a" { LOCK TABLE a2 IN ACCESS SHARE MODE; }
2531
step "s2b" { LOCK TABLE a1 IN SHARE UPDATE EXCLUSIVE MODE; }
2632
step "s2c" { COMMIT; }
2733

2834
session "s3"
29-
setup { BEGIN; }
35+
setup { BEGIN; SET deadlock_timeout = '100s'; }
3036
step "s3a" { LOCK TABLE a2 IN ACCESS EXCLUSIVE MODE; }
3137
step "s3c" { COMMIT; }
3238

3339
session "s4"
34-
setup { BEGIN; }
40+
setup { BEGIN; SET deadlock_timeout = '100s'; }
3541
step "s4a" { LOCK TABLE a2 IN ACCESS EXCLUSIVE MODE; }
3642
step "s4c" { COMMIT; }
3743

0 commit comments

Comments
 (0)