Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2268e6a

Browse files
committed
Fix isolation test to be less timing-dependent
I did this by adding another locking process, which makes the other twowait. This way the output should be stable enough.Per buildfarm and Andres FreundDiscussion:https://postgr.es/m/20180103034445.t3utrtrnrevfsghm@alap3.anarazel.de
1 parent9d4649c commit2268e6a

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
Parsed test spec with2 sessions
1+
Parsed test spec with3 sessions
22

3-
starting permutation: s2l s1i s2i
3+
starting permutation: s2l s1i s2i s3u
4+
pg_advisory_lock
5+
6+
47
step s2l: SELECT pg_advisory_lock(281457);
58
pg_advisory_lock
69

@@ -11,9 +14,11 @@ step s1i:
1114
<waiting ...>
1215
step s2i:
1316
CREATE INDEX CONCURRENTLY mcic_two_pkey ON mcic_two (id)
14-
WHERE unlck();
17+
WHERE unlck() AND lck_shr(572814);
18+
<waiting ...>
19+
step s3u: SELECT unlck();
20+
unlck
1521

22+
t
1623
step s1i: <... completed>
17-
s1
18-
19-
24+
step s2i: <... completed>

‎src/test/isolation/specs/multiple-cic.spec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ session "s1"
2626
step"s1i"{
2727
CREATEINDEXCONCURRENTLYmcic_one_pkeyONmcic_one (id)
2828
WHERElck_shr(281457);
29-
}
30-
teardown{SELECTpg_advisory_unlock_all()AS"s1"; }
29+
}
30+
step"s1u"{SELECTunlck(); }
3131

3232

3333
session"s2"
3434
step"s2l" {SELECTpg_advisory_lock(281457); }
3535
step"s2i"{
3636
CREATEINDEXCONCURRENTLYmcic_two_pkeyONmcic_two (id)
37-
WHEREunlck();
37+
WHEREunlck()ANDlck_shr(572814);
3838
}
3939

40-
permutation"s2l""s1i""s2i"
40+
session"s3"
41+
setup{SELECTpg_advisory_lock(572814); }
42+
step"s3u"{SELECTunlck(); }
43+
44+
permutation"s2l""s1i""s2i""s3u"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp