Commit 392ea0c
committed
Refactor routine to find single log content pattern in TAP tests
The same routine to check if a specific pattern can be found in the
server logs was copied over four different test scripts. This refactors
the whole to use a single routine located in PostgreSQL::Test::Cluster,
named log_contains, to grab the contents of the server logs and check
for a specific pattern.
On HEAD, the code previously used assumed that slurp_file() could not
handle an undefined offset, setting it to zero, but slurp_file() does
do an extra fseek() before retrieving the log contents only if an offset
is defined. In two places, the test was retrieving the full log
contents with slurp_file() after calling substr() to apply an offset,
ignoring that slurp_file() would be able to handle that.
Backpatch all the way down to ease the introduction of new tests that
could rely on the new routine.
Author: Vignesh C
Reviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael Paquier
Discussion: https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.com
Backpatch-through: 111 parent a83edea commit 392ea0c
File tree
5 files changed
+32
-75
lines changed- src/test
- authentication/t
- perl/PostgreSQL/Test
- recovery/t
5 files changed
+32
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 72 | | |
84 | 73 | | |
85 | 74 | | |
| |||
91 | 80 | | |
92 | 81 | | |
93 | 82 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
97 | 86 | | |
98 | 87 | | |
99 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2547 | 2547 | | |
2548 | 2548 | | |
2549 | 2549 | | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
2550 | 2566 | | |
2551 | 2567 | | |
2552 | 2568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 186 | + | |
| 187 | + | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
210 | | - | |
| 208 | + | |
211 | 209 | | |
212 | 210 | | |
213 | 211 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | | - | |
| 238 | + | |
242 | 239 | | |
243 | 240 | | |
244 | 241 | | |
| |||
381 | 378 | | |
382 | 379 | | |
383 | 380 | | |
384 | | - | |
385 | | - | |
| 381 | + | |
386 | 382 | | |
387 | 383 | | |
388 | 384 | | |
| |||
406 | 402 | | |
407 | 403 | | |
408 | 404 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 405 | + | |
| 406 | + | |
412 | 407 | | |
413 | 408 | | |
414 | 409 | | |
| |||
446 | 441 | | |
447 | 442 | | |
448 | 443 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | 444 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 31 | | |
46 | 32 | | |
47 | 33 | | |
| |||
235 | 221 | | |
236 | 222 | | |
237 | 223 | | |
238 | | - | |
239 | | - | |
| 224 | + | |
240 | 225 | | |
241 | 226 | | |
242 | 227 | | |
243 | 228 | | |
244 | | - | |
245 | | - | |
| 229 | + | |
246 | 230 | | |
247 | 231 | | |
248 | 232 | | |
| |||
657 | 641 | | |
658 | 642 | | |
659 | 643 | | |
660 | | - | |
661 | | - | |
| 644 | + | |
662 | 645 | | |
663 | 646 | | |
664 | 647 | | |
665 | 648 | | |
666 | | - | |
667 | | - | |
| 649 | + | |
668 | 650 | | |
669 | 651 | | |
670 | 652 | | |
| |||
0 commit comments