diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2022-03-31 11:16:16 +0200 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2022-03-31 11:16:16 +0200 |
commit | 2beb4acff1e83fef6766a5a7d5bbd952444a0b36 (patch) | |
tree | 85cc0c9fdeb3a632d30f400161c357a18fcac492 /src/test/perl/PostgreSQL/Test/Utils.pm | |
parent | 8f2e2bbf145384784bad07a96d461c6bbd91f597 (diff) | |
download | postgresql-2beb4acff1e83fef6766a5a7d5bbd952444a0b36.tar.gz postgresql-2beb4acff1e83fef6766a5a7d5bbd952444a0b36.zip |
Add diagnostic output on error in pump_until
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
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Utils.pm')
-rw-r--r-- | src/test/perl/PostgreSQL/Test/Utils.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm index 15b314d1f89..dca1b3b17c4 100644 --- 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; |