File tree 4 files changed +111
-1
lines changed
src/test/modules/injection_points
4 files changed +111
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ PGFILEDESC = "injection_points - facility for injection points"
13
13
REGRESS = injection_points reindex_conc
14
14
REGRESS_OPTS = --dlpath=$(top_builddir ) /src/test/regress
15
15
16
- ISOLATION = inplace
16
+ ISOLATION = basic inplace
17
17
18
18
TAP_TESTS = 1
19
19
Original file line number Diff line number Diff line change
1
+ Parsed test spec with 2 sessions
2
+
3
+ starting permutation: wait1 wakeup2 detach2
4
+ injection_points_attach
5
+ -----------------------
6
+
7
+ (1 row)
8
+
9
+ step wait1: SELECT injection_points_run('injection-points-wait'); <waiting ...>
10
+ step wakeup2: SELECT injection_points_wakeup('injection-points-wait');
11
+ injection_points_wakeup
12
+ -----------------------
13
+
14
+ (1 row)
15
+
16
+ step wait1: <... completed>
17
+ injection_points_run
18
+ --------------------
19
+
20
+ (1 row)
21
+
22
+ step detach2: SELECT injection_points_detach('injection-points-wait');
23
+ injection_points_detach
24
+ -----------------------
25
+
26
+ (1 row)
27
+
28
+
29
+ starting permutation: wait1 detach2 wakeup2
30
+ injection_points_attach
31
+ -----------------------
32
+
33
+ (1 row)
34
+
35
+ step wait1: SELECT injection_points_run('injection-points-wait'); <waiting ...>
36
+ step detach2: SELECT injection_points_detach('injection-points-wait');
37
+ injection_points_detach
38
+ -----------------------
39
+
40
+ (1 row)
41
+
42
+ step wakeup2: SELECT injection_points_wakeup('injection-points-wait');
43
+ injection_points_wakeup
44
+ -----------------------
45
+
46
+ (1 row)
47
+
48
+ step wait1: <... completed>
49
+ injection_points_run
50
+ --------------------
51
+
52
+ (1 row)
53
+
54
+
55
+ starting permutation: detach2 wait1 wakeup2
56
+ injection_points_attach
57
+ -----------------------
58
+
59
+ (1 row)
60
+
61
+ step detach2: SELECT injection_points_detach('injection-points-wait');
62
+ injection_points_detach
63
+ -----------------------
64
+
65
+ (1 row)
66
+
67
+ step wait1: SELECT injection_points_run('injection-points-wait');
68
+ injection_points_run
69
+ --------------------
70
+
71
+ (1 row)
72
+
73
+ step wakeup2: SELECT injection_points_wakeup('injection-points-wait');
74
+ ERROR: could not find injection point injection-points-wait to wake up
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ tests += {
42
42
},
43
43
' isolation' : {
44
44
' specs' : [
45
+ ' basic' ,
45
46
' inplace' ,
46
47
],
47
48
},
Original file line number Diff line number Diff line change
1
+ # Basic isolation test for injection points.
2
+ #
3
+ # This checks the interactions between wakeup, wait and detach.
4
+ # Feel free to use it as a template when implementing an isolation
5
+ # test with injection points.
6
+
7
+ setup
8
+ {
9
+ CREATE EXTENSION injection_points ;
10
+ }
11
+ teardown
12
+ {
13
+ DROP EXTENSION injection_points ;
14
+ }
15
+
16
+ # Wait happens in the first session, wakeup in the second session.
17
+ session s1
18
+ setup {
19
+ SELECT injection_points_set_local ( ) ;
20
+ SELECT injection_points_attach ( 'injection-points-wait' , 'wait' ) ;
21
+ }
22
+ step wait1 { SELECT injection_points_run ( 'injection-points-wait' ) ; }
23
+
24
+ session s2
25
+ step wakeup2 { SELECT injection_points_wakeup ( 'injection-points-wait' ) ; }
26
+ step detach2 { SELECT injection_points_detach ( 'injection-points-wait' ) ; }
27
+
28
+ # Detach after wait and wakeup.
29
+ permutation wait1 wakeup2 detach2
30
+
31
+ # Detach before wakeup. s1 waits until wakeup, ignores the detach.
32
+ permutation wait1 detach2 wakeup2
33
+
34
+ # Detach before wait does not cause a wait, wakeup produces an error.
35
+ permutation detach2 wait1 wakeup2
You can’t perform that action at this time.
0 commit comments