|
16 | 16 | }
|
17 | 17 | else
|
18 | 18 | {
|
19 |
| - plan tests => 9; |
| 19 | + plan tests => 11; |
20 | 20 | }
|
21 | 21 |
|
22 | 22 |
|
@@ -130,11 +130,23 @@ BEGIN
|
130 | 130 | my $ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
|
131 | 131 | is($ret, 0, 'killed process with KILL');
|
132 | 132 |
|
133 |
| -# Close psql session |
| 133 | +# Close that psql session |
134 | 134 | $killme->finish;
|
| 135 | + |
| 136 | +# Wait till the other session reports failure, ensuring that the postmaster |
| 137 | +# has noticed its dead child and begun a restart cycle. |
| 138 | +$killme_stdin2 .= qq[ |
| 139 | +SELECT pg_sleep($TestLib::timeout_default); |
| 140 | +]; |
| 141 | +ok( pump_until( |
| 142 | + $killme2, |
| 143 | + \$killme_stderr2, |
| 144 | + qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly|connection to server was lost|could not send data to server/m |
| 145 | + ), |
| 146 | + "second psql session died successfully after SIGKILL"); |
135 | 147 | $killme2->finish;
|
136 | 148 |
|
137 |
| -# Wait till server restarts |
| 149 | +# Wait till server finishes restarting |
138 | 150 | $node->poll_query_until('postgres', undef, '');
|
139 | 151 |
|
140 | 152 | # Check for temporary files
|
@@ -219,11 +231,23 @@ BEGIN
|
219 | 231 | $ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
|
220 | 232 | is($ret, 0, 'killed process with KILL');
|
221 | 233 |
|
222 |
| -# Close psql session |
| 234 | +# Close that psql session |
223 | 235 | $killme->finish;
|
| 236 | + |
| 237 | +# Wait till the other session reports failure, ensuring that the postmaster |
| 238 | +# has noticed its dead child and begun a restart cycle. |
| 239 | +$killme_stdin2 .= qq[ |
| 240 | +SELECT pg_sleep($TestLib::timeout_default); |
| 241 | +]; |
| 242 | +ok( pump_until( |
| 243 | + $killme2, |
| 244 | + \$killme_stderr2, |
| 245 | + qr/WARNING: terminating connection because of crash of another server process|server closed the connection unexpectedly|connection to server was lost|could not send data to server/m |
| 246 | + ), |
| 247 | + "second psql session died successfully after SIGKILL"); |
224 | 248 | $killme2->finish;
|
225 | 249 |
|
226 |
| -# Wait till server restarts |
| 250 | +# Wait till server finishes restarting |
227 | 251 | $node->poll_query_until('postgres', undef, '');
|
228 | 252 |
|
229 | 253 | # Check for temporary files -- should be there
|
|
0 commit comments