forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd380ec9
committed
Allow TestLib::slurp_file to skip contents, and use as needed
In order to avoid getting old logfile contents certain functions inPostgresNode were doing one of two things. On Windows it rotated thelogfile and restarted the server, while elsewhere it truncated the logfile. Both of these are unnecessary. We borrow from the buildfarm whichdoes this instead: note the size of the logfile before we start, andthen when fetching the logfile skip to that position before accumulatingcontents. This is spelled differently on Windows but the effect is thesame. This is largely centralized in TestLib's slurp_file function,which has a new optional parameter, the offset to skip to beforestarting to reading the file. Code in the client becomes much neater.Backpatch to all live branches.Michael Paquier, slightly modified by me.Discussion:https://postgr.es/m/YHajnhcMAI3++pJL@paquier.xyz1 parent26cf324 commitd380ec9
2 files changed
+16
-8
lines changedLines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1673 | 1673 |
| |
1674 | 1674 |
| |
1675 | 1675 |
| |
1676 |
| - | |
1677 |
| - | |
1678 |
| - | |
1679 | 1676 |
| |
1680 | 1677 |
| |
1681 | 1678 |
| |
| |||
1687 | 1684 |
| |
1688 | 1685 |
| |
1689 | 1686 |
| |
1690 |
| - | |
| 1687 | + | |
| 1688 | + | |
1691 | 1689 |
| |
1692 | 1690 |
| |
1693 |
| - | |
| 1691 | + | |
1694 | 1692 |
| |
1695 | 1693 |
| |
1696 | 1694 |
| |
|
Lines changed: 13 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
| 85 | + | |
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
262 |
| - | |
| 262 | + | |
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
268 | 268 |
| |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
269 | 274 |
| |
270 | 275 |
| |
271 | 276 |
| |
| |||
275 | 280 |
| |
276 | 281 |
| |
277 | 282 |
| |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
278 | 288 |
| |
279 | 289 |
| |
280 | 290 |
| |
|
0 commit comments
Comments
(0)