Skip to content

Commit 926c7fc

Browse files
committed
injection_points: Tweak more permutation in isolation test "basic"
The CI has reported that using a marker to force the output of the detach step to happen after the wait step was not enough, as isolationtester has managed to report the detach step as waiting before the wait step finishes in some runs. src/test/isolation/README tells that there is a more drastic method to enforce the ordering of the output: an empty step positioned just after the wait step can force the wait step to complete before the detach step begins. This method has been able to pass 10 runs in the CI here, while HEAD seems to fail 15~20% of the time in the CF bot. Discussion: https://postgr.es/m/Z6WO8FbqK_FHmrzC@paquier.xyz
1 parent 428fadb commit 926c7fc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/test/modules/injection_points/expected/basic.out

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Parsed test spec with 2 sessions
22

3-
starting permutation: wait1 wakeup2 detach2
3+
starting permutation: wait1 wakeup2 noop1 detach2
44
injection_points_attach
55
-----------------------
66

@@ -19,6 +19,7 @@ injection_points_run
1919

2020
(1 row)
2121

22+
step noop1:
2223
step detach2: SELECT injection_points_detach('injection-points-wait');
2324
injection_points_detach
2425
-----------------------

src/test/modules/injection_points/specs/basic.spec

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ setup {
2020
SELECT injection_points_attach('injection-points-wait', 'wait');
2121
}
2222
step wait1 { SELECT injection_points_run('injection-points-wait'); }
23+
step noop1 { }
2324

2425
session s2
2526
step wakeup2 { SELECT injection_points_wakeup('injection-points-wait'); }
2627
step detach2 { SELECT injection_points_detach('injection-points-wait'); }
2728

2829
# Detach after wait and wakeup. Note that the detach may finish before
2930
# the SQL function doing the wait returns its result. In order to avoid
30-
# any ordering issues, the detach step reports its result only once the
31-
# wait has completed. This is enforced with a parenthesized marker.
32-
permutation wait1 wakeup2 detach2(wait1)
31+
# any ordering issues, a no-op step is added after the wait, so as the
32+
# detach is not launched until the wait has completed.
33+
permutation wait1 wakeup2 noop1 detach2
3334

3435
# Detach before wakeup. s1 waits until wakeup, ignores the detach.
3536
permutation wait1 detach2 wakeup2

0 commit comments

Comments
 (0)