Commit 664d757
committed
Refactor background psql TAP functions
This breaks out the background and interactive psql functionality into a
new class, PostgreSQL::Test::BackgroundPsql. Sessions are still initiated
via PostgreSQL::Test::Cluster, but once started they can be manipulated by
the new helper functions which intend to make querying easier. A sample
session for a command which can be expected to finish at a later time can
be seen below.
my $session = $node->background_psql('postgres');
$bsession->query_until(qr/start/, q(
\echo start
CREATE INDEX CONCURRENTLY idx ON t(a);
));
$bsession->quit;
Patch by Andres Freund with some additional hacking by me.
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/20230130194350.zj5v467x4jgqt3d6@awork3.anarazel.de1 parent 32bc0d0 commit 664d757
File tree
7 files changed
+388
-242
lines changed- contrib/amcheck/t
- src
- bin/psql/t
- test
- perl/PostgreSQL/Test
- recovery/t
- subscription/t
7 files changed
+388
-242
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
60 | 49 | | |
61 | 50 | | |
62 | | - | |
63 | | - | |
| 51 | + | |
64 | 52 | | |
65 | | - | |
| 53 | + | |
66 | 54 | | |
67 | | - | |
| 55 | + | |
68 | 56 | | |
69 | | - | |
| 57 | + | |
70 | 58 | | |
71 | 59 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 60 | + | |
75 | 61 | | |
76 | 62 | | |
77 | 63 | | |
78 | | - | |
| 64 | + | |
79 | 65 | | |
80 | 66 | | |
81 | 67 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 68 | + | |
85 | 69 | | |
86 | 70 | | |
87 | 71 | | |
88 | | - | |
| 72 | + | |
89 | 73 | | |
90 | 74 | | |
91 | | - | |
92 | | - | |
| 75 | + | |
93 | 76 | | |
94 | | - | |
95 | | - | |
| 77 | + | |
| 78 | + | |
96 | 79 | | |
97 | 80 | | |
98 | 81 | | |
| |||
113 | 96 | | |
114 | 97 | | |
115 | 98 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 99 | + | |
| 100 | + | |
124 | 101 | | |
125 | 102 | | |
126 | 103 | | |
127 | | - | |
128 | | - | |
| 104 | + | |
129 | 105 | | |
130 | 106 | | |
131 | | - | |
| 107 | + | |
132 | 108 | | |
133 | 109 | | |
134 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 94 | + | |
103 | 95 | | |
104 | 96 | | |
105 | 97 | | |
| |||
109 | 101 | | |
110 | 102 | | |
111 | 103 | | |
112 | | - | |
113 | | - | |
114 | 104 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
121 | 110 | | |
122 | 111 | | |
123 | 112 | | |
| |||
451 | 440 | | |
452 | 441 | | |
453 | 442 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 443 | + | |
458 | 444 | | |
459 | 445 | | |
460 | 446 | | |
| |||
0 commit comments