pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Allow TestLib::slurp_file to skip contents, and use as needed 6+ messages / 1 participants [nested] [flat]
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3c5b0685b921533f37622345beb0f8dd49200c01 Modified Files -------------- src/test/perl/PostgresNode.pm | 46 +++++++++---------------------------------- src/test/perl/TestLib.pm | 21 +++++++++++++++----- 2 files changed, 25 insertions(+), 42 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e480c6dd33f40bf4a2ae561799b08a1cd7c3073b Modified Files -------------- src/test/perl/PostgresNode.pm | 8 +++----- src/test/perl/TestLib.pm | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d380ec9891db13d8a4fc8a40adc68880a88ecb31 Modified Files -------------- src/test/perl/PostgresNode.pm | 8 +++----- src/test/perl/TestLib.pm | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4c9298130ae8d4f3ba4149fbda3b95f6c86258d9 Modified Files -------------- src/test/perl/PostgresNode.pm | 8 +++----- src/test/perl/TestLib.pm | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f8ba416a98ceded2f97bd3aaa06b081c216ac4d7 Modified Files -------------- src/test/perl/PostgresNode.pm | 8 +++----- src/test/perl/TestLib.pm | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Allow TestLib::slurp_file to skip contents, and use as needed @ 2021-04-16 21:42 Andrew Dunstan <andrew@dunslane.net> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Dunstan @ 2021-04-16 21:42 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Allow TestLib::slurp_file to skip contents, and use as needed In order to avoid getting old logfile contents certain functions in PostgresNode were doing one of two things. On Windows it rotated the logfile and restarted the server, while elsewhere it truncated the log file. Both of these are unnecessary. We borrow from the buildfarm which does this instead: note the size of the logfile before we start, and then when fetching the logfile skip to that position before accumulating contents. This is spelled differently on Windows but the effect is the same. This is largely centralized in TestLib's slurp_file function, which has a new optional parameter, the offset to skip to before starting 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.xyz Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d48212c45202ba9ae1ff1a68daad67b53da99dc4 Modified Files -------------- src/test/perl/PostgresNode.pm | 8 +++----- src/test/perl/TestLib.pm | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-04-16 21:42 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net> 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net> 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net> 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net> 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net> 2021-04-16 21:42 pgsql: Allow TestLib::slurp_file to skip contents, and use as needed Andrew Dunstan <andrew@dunslane.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox