Skip to content

Commit a23ab2e

Browse files
Reorder connection markers in loadbalance tests
Commit 7f5b198 introduced TAP tests that use string literals to mark the presence of a query in server logs. Reorder the markers to make sure they are used in alphabetical order for easier debugging. Author: Gurjeet Singh <gurjeet@singh.im> Reviewed-by: Jelte Fennema <postgres@jeltef.nl> Discussion: https://postgr.es/m/CABwTF4WcYAENqyUQS2crAYfDuJ497v82ty2-MirjaC+zz9e8nQ@mail.gmail.com
1 parent 60ce452 commit a23ab2e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/interfaces/libpq/t/003_load_balance_host_list.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@
3636
# load_balance_hosts=disable should always choose the first one.
3737
$node1->connect_ok("host=$hostlist port=$portlist load_balance_hosts=disable",
3838
"load_balance_hosts=disable connects to the first node",
39-
sql => "SELECT 'connect2'",
40-
log_like => [qr/statement: SELECT 'connect2'/]);
39+
sql => "SELECT 'connect1'",
40+
log_like => [qr/statement: SELECT 'connect1'/]);
4141

4242
# Statistically the following loop with load_balance_hosts=random will almost
4343
# certainly connect at least once to each of the nodes. The chance of that not
4444
# happening is so small that it's negligible: (2/3)^50 = 1.56832855e-9
4545
foreach my $i (1 .. 50) {
4646
$node1->connect_ok("host=$hostlist port=$portlist load_balance_hosts=random",
4747
"repeated connections with random load balancing",
48-
sql => "SELECT 'connect1'");
48+
sql => "SELECT 'connect2'");
4949
}
5050

51-
my $node1_occurences = () = $node1->log_content() =~ /statement: SELECT 'connect1'/g;
52-
my $node2_occurences = () = $node2->log_content() =~ /statement: SELECT 'connect1'/g;
53-
my $node3_occurences = () = $node3->log_content() =~ /statement: SELECT 'connect1'/g;
51+
my $node1_occurences = () = $node1->log_content() =~ /statement: SELECT 'connect2'/g;
52+
my $node2_occurences = () = $node2->log_content() =~ /statement: SELECT 'connect2'/g;
53+
my $node3_occurences = () = $node3->log_content() =~ /statement: SELECT 'connect2'/g;
5454

5555
my $total_occurences = $node1_occurences + $node2_occurences + $node3_occurences;
5656

src/interfaces/libpq/t/004_load_balance_dns.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
# load_balance_hosts=disable should always choose the first one.
7979
$node1->connect_ok("host=pg-loadbalancetest port=$port load_balance_hosts=disable",
8080
"load_balance_hosts=disable connects to the first node",
81-
sql => "SELECT 'connect2'",
82-
log_like => [qr/statement: SELECT 'connect2'/]);
81+
sql => "SELECT 'connect1'",
82+
log_like => [qr/statement: SELECT 'connect1'/]);
8383

8484

8585
# Statistically the following loop with load_balance_hosts=random will almost
@@ -88,12 +88,12 @@
8888
foreach my $i (1 .. 50) {
8989
$node1->connect_ok("host=pg-loadbalancetest port=$port load_balance_hosts=random",
9090
"repeated connections with random load balancing",
91-
sql => "SELECT 'connect1'");
91+
sql => "SELECT 'connect2'");
9292
}
9393

94-
my $node1_occurences = () = $node1->log_content() =~ /statement: SELECT 'connect1'/g;
95-
my $node2_occurences = () = $node2->log_content() =~ /statement: SELECT 'connect1'/g;
96-
my $node3_occurences = () = $node3->log_content() =~ /statement: SELECT 'connect1'/g;
94+
my $node1_occurences = () = $node1->log_content() =~ /statement: SELECT 'connect2'/g;
95+
my $node2_occurences = () = $node2->log_content() =~ /statement: SELECT 'connect2'/g;
96+
my $node3_occurences = () = $node3->log_content() =~ /statement: SELECT 'connect2'/g;
9797

9898
my $total_occurences = $node1_occurences + $node2_occurences + $node3_occurences;
9999

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy