forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf452aaf
committed
Restore robustness of TAP tests that wait for postmaster restart.
Several TAP tests use poll_query_until() to wait for the postmasterto restart. They were checking to see if a trivial query(e.g. "SELECT 1") succeeds. However, that's problematic in the wakeof commit11e9caf, because now that we feed said query to psqlvia stdin, we risk IPC::Run whining about a SIGPIPE failure if psqlquits before reading the query. Hence, we can't use a nonemptyquery in cases where we need to wait for connection failures tostop happening.Per the precedent of commitsc757a3d and6d41dd0, we can pass"undef" as the query in such cases to ensure that IPC::Run hasnothing to write. However, then we have to say that the expectedoutput is empty, and this exposes a deficiency in poll_query_until:if psql fails altogether and returns empty stdout, poll_query_untilwill treat that as a success! That's because, contrary to itsdocumentation, it makes no actual check for psql failure, lookingneither at the exit status nor at stderr.To fix that, adjust poll_query_until to insist on empty stderr aswell as a stdout match. (I experimented with checking exit statusinstead, but it seems that psql often does exit(1) in cases that weneed to consider successes. That might be something to fix someday,but it would be a non-back-patchable behavior change.)Back-patch to v10. The test cases needing this exist only as farback as v11, but it seems wise to keep poll_query_until's behaviorthe same in v10, in case we back-patch another such test case infuture. (9.6 does not currently need this change, because in thatbranch poll_query_until can't be told to accept empty stdout asa success case.)Per assorted buildfarm failures, mostly on hoverfly.Discussion:https://postgr.es/m/CAA4eK1+zM6L4QSA1XMvXY_qqWwdUmqkOS1+hWvL8QcYEBGA1Uw@mail.gmail.com1 parent1250aad commitf452aaf
File tree
3 files changed
+8
-12
lines changed- src/test
- perl
- recovery/t
3 files changed
+8
-12
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2140 | 2140 |
| |
2141 | 2141 |
| |
2142 | 2142 |
| |
| 2143 | + | |
| 2144 | + | |
2143 | 2145 |
| |
2144 |
| - | |
| 2146 | + | |
2145 | 2147 |
| |
2146 | 2148 |
| |
2147 | 2149 |
| |
| |||
2154 | 2156 |
| |
2155 | 2157 |
| |
2156 | 2158 |
| |
2157 |
| - | |
2158 |
| - | |
2159 | 2159 |
| |
2160 | 2160 |
| |
2161 | 2161 |
| |
|
Lines changed: 3 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
| 139 | + | |
| 140 | + | |
145 | 141 |
| |
146 | 142 |
| |
147 | 143 |
| |
| |||
216 | 212 |
| |
217 | 213 |
| |
218 | 214 |
| |
219 |
| - | |
| 215 | + | |
220 | 216 |
| |
221 | 217 |
| |
222 | 218 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 |
| - | |
| 142 | + | |
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
| 231 | + | |
232 | 232 |
| |
233 | 233 |
| |
234 | 234 |
| |
|
0 commit comments
Comments
(0)