summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Korotkov2024-03-15 19:35:18 +0000
committerAlexander Korotkov2024-03-15 19:37:17 +0000
commit605062227fdc8331f2ffa0f60e7a8724b6e56480 (patch)
tree27924d92148d3204af7e7894eedae6eb053372a4
parent196eeb6b2f7cf5f95293259efe0e5d73e8d0025d (diff)
Use locale-aware value for \watch in 005_timeouts.pl
Reported-by: Alexander Lakhin
-rw-r--r--src/test/modules/test_misc/t/005_timeouts.pl18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/test/modules/test_misc/t/005_timeouts.pl b/src/test/modules/test_misc/t/005_timeouts.pl
index dc452136853..a792610231a 100644
--- a/src/test/modules/test_misc/t/005_timeouts.pl
+++ b/src/test/modules/test_misc/t/005_timeouts.pl
@@ -3,6 +3,8 @@
use strict;
use warnings;
+use locale;
+
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
use Time::HiRes qw(usleep);
@@ -35,14 +37,16 @@ my $psql_session = $node->background_psql('postgres');
# The following query will generate a stream of SELECT 1 queries. This is done
# so to exercise transaction timeout in the presence of short queries.
+# Note: the interval value is parsed with locale-aware strtod()
$psql_session->query_until(
- qr/starting_bg_psql/, q(
- \echo starting_bg_psql
- SET transaction_timeout to '10ms';
- BEGIN;
- SELECT 1 \watch 0.001
- \q
-));
+ qr/starting_bg_psql/,
+ sprintf(
+ q(\echo starting_bg_psql
+ SET transaction_timeout to '10ms';
+ BEGIN;
+ SELECT 1 \watch %g
+ \q
+), 0.001));
# Wait until the backend enters the timeout injection point. Will get an error
# here if anything goes wrong.