git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f2e2bb)
Add diagnostic output on error in pump_until
2022年3月31日 09:16:16 +0000 (11:16 +0200)
2022年3月31日 09:16:16 +0000 (11:16 +0200)
When pump_until was moved to Utils.pm in commit 6da65a3f9 the diag
calls were removed, this puts them back.

Per request from Andres Freund.

Discussion: https://postgr.es/m/20220329225819.ahk5u2tax3ez6d2t@alap3.anarazel.de


diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index 15b314d1f8901588f05c3efff8a4cbafd51e10ac..dca1b3b17c4e95c630d8e52331916f9aa25446ac 100644 (file)
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -426,8 +426,16 @@ sub pump_until
while (1)
{
last if $$stream =~ /$until/;
- return 0 if ($timeout->is_expired);
- return 0 if (not $proc->pumpable());
+ if ($timeout->is_expired)
+ {
+ diag("pump_until: timeout expired when searching for \"$until\" with stream: \"$$stream\"");
+ return 0;
+ }
+ if (not $proc->pumpable())
+ {
+ diag("pump_until: process terminated unexpectedly when searching for \"$until\" with stream: \"$$stream\"");
+ return 0;
+ }
$proc->pump();
}
return 1;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /