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

Commit77d5dea

Browse files
committed
Fix LDAP test instability.
After starting slapd, wait until it can accept a connection beforebeginning the real test work. This avoids occasional test failures.Back-patch to 11, where the LDAP tests arrived.Author: Thomas MunroReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/20190719033013.GI1859%40paquier.xyz
1 parente465d9d commit77d5dea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎src/test/ldap/t/001_auth.pl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ END
113113
append_to_file($ldap_pwfile,$ldap_rootpw);
114114
chmod 0600,$ldap_pwfileordie;
115115

116+
# wait until slapd accepts requests
117+
my$retries = 0;
118+
while (1)
119+
{
120+
last
121+
if (
122+
system_log(
123+
"ldapsearch","-h",$ldap_server,"-p",
124+
$ldap_port,"-s","base","-b",
125+
$ldap_basedn,"-D",$ldap_rootdn,"-y",
126+
$ldap_pwfile,"-n","'objectclass=*'") == 0);
127+
die"cannot connect to slapd"if ++$retries >= 300;
128+
note"waiting for slapd to accept requests...";
129+
Time::HiRes::usleep(1000000);
130+
}
131+
116132
$ENV{'LDAPURI'} =$ldap_url;
117133
$ENV{'LDAPBINDDN'} =$ldap_rootdn;
118134
$ENV{'LDAPCONF'} =$ldap_conf;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp