On Tue, Nov 28, 2023 at 6:48 AM Masahiko Sawada <sawada.m...@gmail.com> wrote: > > Hi, > > While adding some TAP tests, I realized that set_query_timer_restart() > in BackgroundPsql may not work. Specifically, it seems not to work > unless we pass an argument to the function. Here is the test script I > used: > > If calling set_query_timer_restart() works properly, this test would > pass since we reset the query timeout before executing the second > pg_sleep(3). However, this test fail on my environment unless I use > set_query_timer_restart(1) (i.e. passing something to the function).
Right. > Currently authentication/t/001_password.pl is the sole user of > set_query_timer_restart() function. I think we should define a value > to query_timer_restart in set_query_timer_restart() function even if > no argument is passed, like the patch attached, or we should change > the caller to pass 1 to the function. It is added by commit 664d7575 and I agree that calling the function without argument doesn't reset the query_timer_restart as intended. A nitpick on the patch - how about honoring the passed-in parameter with something like $self->{query_timer_restart} = 1 if !defined $self->{query_timer_restart}; instead of just setting it to 1 (a value other than undef) $self->{query_timer_restart} = 1;? -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com