forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita9231fe
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 theserver logs was copied over four different test scripts. This refactorsthe whole to use a single routine located in PostgreSQL::Test::Cluster,named log_contains, to grab the contents of the server logs and checkfor a specific pattern.On HEAD, the code previously used assumed that slurp_file() could nothandle an undefined offset, setting it to zero, but slurp_file() doesdo an extra fseek() before retrieving the log contents only if an offsetis defined. In two places, the test was retrieving the full logcontents 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 thatcould rely on the new routine.Author: Vignesh CReviewed-by: Andrew Dunstan, Dagfinn Ilmari Mannsåker, Michael PaquierDiscussion:https://postgr.es/m/CALDaNm0YSiLpjCmajwLfidQrFOrLNKPQir7s__PeVvh9U3uoTQ@mail.gmail.comBackpatch-through: 111 parent1536e32 commita9231fe
File tree
3 files changed
+21
-33
lines changed- src/test
- perl
- recovery/t
3 files changed
+21
-33
lines changedLines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2081 | 2081 |
| |
2082 | 2082 |
| |
2083 | 2083 |
| |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2084 | 2099 |
| |
2085 | 2100 |
| |
2086 | 2101 |
| |
|
Lines changed: 4 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
168 |
| - | |
169 |
| - | |
| 168 | + | |
170 | 169 |
| |
171 | 170 |
| |
172 | 171 |
| |
| |||
188 | 187 |
| |
189 | 188 |
| |
190 | 189 |
| |
191 |
| - | |
192 |
| - | |
| 190 | + | |
193 | 191 |
| |
194 | 192 |
| |
195 | 193 |
| |
| |||
212 | 210 |
| |
213 | 211 |
| |
214 | 212 |
| |
215 |
| - | |
| 213 | + | |
216 | 214 |
| |
217 | 215 |
| |
218 | 216 |
| |
| |||
242 | 240 |
| |
243 | 241 |
| |
244 | 242 |
| |
245 |
| - | |
246 |
| - | |
| 243 | + | |
247 | 244 |
| |
248 | 245 |
| |
249 | 246 |
| |
| |||
318 | 315 |
| |
319 | 316 |
| |
320 | 317 |
| |
321 |
| - | |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 |
| - | |
331 |
| - | |
332 |
| - | |
333 |
| - | |
334 |
| - |
Lines changed: 2 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
136 |
| - | |
| 135 | + | |
| 136 | + | |
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - |
0 commit comments
Comments
(0)