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

Commit36c1c91

Browse files
committed
Make regression test for multiple synchronous standbys more stable.
The regression test checks whether the output of pg_stat_replication isexpected or not after changing synchronous_standby_names and reloadingthe configuration file. Regarding this test logic, previously there wasa timing issue which made the test result unstable. That is,pg_stat_replication could return unexpected result during small windowafter the configuration file was reloaded before new setting valuetook effect, and which made the test fail.This commit changes the test logic so that it uses a loop with a timeoutto give some room for the test to pass. Now the test fails only whenpg_stat_replication keeps returning unexpected result for 30 seconds.Michael Paquier
1 parentf0e766b commit36c1c91

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

‎src/test/recovery/t/007_sync_rep.pl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,23 @@ sub test_sync_state
2222
$self->reload;
2323
}
2424

25-
my$result =$self->safe_psql('postgres',$check_sql);
25+
my$timeout_max = 30;
26+
my$timeout = 0;
27+
my$result;
28+
29+
# A reload may take some time to take effect on busy machines,
30+
# hence use a loop with a timeout to give some room for the test
31+
# to pass.
32+
while ($timeout <$timeout_max)
33+
{
34+
$result =$self->safe_psql('postgres',$check_sql);
35+
36+
lastif ($resulteq$expected);
37+
38+
$timeout++;
39+
sleep 1;
40+
}
41+
2642
is($result,$expected,$msg);
2743
}
2844

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp