From dd92c112308c36b72866bc99cc75bf610ccdccc5 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 20 Feb 2025 00:54:34 +0100 Subject: [PATCH v3 1/2] Configure interactive instance to restart timer Use the published API from BackgroundPsql for automatically restarting the timer rather than manually reaching into it to achieve the same thing. Reviewed-by: Heikki Linnakangas Reviewed-by: Andrew Dunstan Discussion: https://postgr.es/m/1100715.1712265845@sss.pgh.pa.us --- src/bin/psql/t/010_tab_completion.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bin/psql/t/010_tab_completion.pl b/src/bin/psql/t/010_tab_completion.pl index fa7427af8c5..c391c3b3be5 100644 --- a/src/bin/psql/t/010_tab_completion.pl +++ b/src/bin/psql/t/010_tab_completion.pl @@ -77,8 +77,10 @@ close $FH; # for possible debugging purposes. my $historyfile = "${PostgreSQL::Test::Utils::log_path}/010_psql_history.txt"; -# fire up an interactive psql session +# fire up an interactive psql session and configure it such that each query +# restarts the timer my $h = $node->interactive_psql('postgres', history_file => $historyfile); +$h->set_query_timer_restart(); # Simple test case: type something and see if psql responds as expected sub check_completion @@ -88,9 +90,6 @@ sub check_completion # report test failures from caller location local $Test::Builder::Level = $Test::Builder::Level + 1; - # restart per-command timer - $h->{timeout}->start($PostgreSQL::Test::Utils::timeout_default); - # send the data to be sent and wait for its result my $out = $h->query_until($pattern, $send); my $okay = ($out =~ $pattern && !$h->{timeout}->is_expired); -- 2.39.3 (Apple Git-146)