Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd11eae0

Browse files
committed
Fix bogus loop logic in 013_crash_restart test's pump_until subroutine.
The pump_nb() step might've already received the desired data, so we mustcheck for that at the top of the loop not the bottom. Otherwise, thecall to pump() will sit with nothing to do until the timeout elapses.pump_until then falls out with apparent success ... but the timeout hasbeen used up, causing the next call of pump_until to report a timeoutfailure. I believe this explains the intermittent timeout failureswe've seen in the buildfarm ever since this test went in. I was ableto reproduce the problem on gaur semi-repeatably, and this appears tofix it.In passing, remove a duplicate assignment, fix one stdin-assignment tolook like the rest, and document the test's dependency on test_decoding.
1 parent4a2994f commitd11eae0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎src/test/recovery/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Running the tests
99
=================
1010

1111
NOTE: You must have given the --enable-tap-tests argument to configure.
12+
Also, to use "make installcheck", you must have built and installed
13+
contrib/test_decoding in addition to the core code.
1214

1315
Run
1416
make check

‎src/test/recovery/t/013_crash_restart.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
"acquired pid for SIGKILL");
158158
$pid =$killme_stdout;
159159
chomp($pid);
160-
$pid =$killme_stdout;
161160
$killme_stdout ='';
162161
$killme_stderr ='';
163162

@@ -176,7 +175,7 @@
176175
# signal that crash-restart has occurred. The initial wait for the
177176
# trivial select is to be sure that psql successfully connected to
178177
# backend.
179-
$monitor_stdin =q[
178+
$monitor_stdin.=q[
180179
SELECT $$psql-connected$$;
181180
SELECT pg_sleep(3600);
182181
];
@@ -252,6 +251,7 @@ sub pump_until
252251
$proc->pump_nb();
253252
while (1)
254253
{
254+
lastif$$stream =~/$untl/;
255255
if ($psql_timeout->is_expired)
256256
{
257257
diag("aborting wait: program timed out");
@@ -269,7 +269,6 @@ sub pump_until
269269
return 0;
270270
}
271271
$proc->pump();
272-
lastif$$stream =~/$untl/;
273272
}
274273
return 1;
275274

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp