forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3509a06
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 parent15b7775 commit3509a06
File tree
2 files changed
+17
-12
lines changed- src/test
- perl
- recovery/t
2 files changed
+17
-12
lines changedLines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1972 | 1972 |
| |
1973 | 1973 |
| |
1974 | 1974 |
| |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
1975 | 1990 |
| |
1976 | 1991 |
| |
1977 | 1992 |
| |
|
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)