Adjust some comments about structure properties in pg_stat.h
[pgsql.git] / src / test / modules / injection_points / specs / basic.spec
blob47db676c0c19b47169b4cf80b9172848004529b6
1 # Basic isolation test for injection points.
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.
7 setup
9 CREATE EXTENSION injection_points;
11 teardown
13 DROP EXTENSION injection_points;
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');
22 step wait1 { SELECT injection_points_run('injection-points-wait'); }
24 session s2
25 step wakeup2 { SELECT injection_points_wakeup('injection-points-wait'); }
26 step detach2 { SELECT injection_points_detach('injection-points-wait'); }
28 # Detach after wait and wakeup.
29 # Permutations like the following one commented out should be avoided, as
30 # the detach may finish before the SQL function doing the wait returns
31 # its result. It is recommended to use wakeups as the last permutation
32 # should a wait be done within an SQL function.
33 #permutation wait1 wakeup2 detach2
35 # Detach before wakeup. s1 waits until wakeup, ignores the detach.
36 permutation wait1 detach2 wakeup2
38 # Detach before wait does not cause a wait, wakeup produces an error.
39 permutation detach2 wait1 wakeup2