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

Commit27cd521

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 parentf63d9e6 commit27cd521

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
@@ -120,6 +120,22 @@ END
120120
append_to_file($ldap_pwfile,$ldap_rootpw);
121121
chmod 0600,$ldap_pwfileordie;
122122

123+
# wait until slapd accepts requests
124+
my$retries = 0;
125+
while (1)
126+
{
127+
last
128+
if (
129+
system_log(
130+
"ldapsearch","-h",$ldap_server,"-p",
131+
$ldap_port,"-s","base","-b",
132+
$ldap_basedn,"-D",$ldap_rootdn,"-y",
133+
$ldap_pwfile,"-n","'objectclass=*'") == 0);
134+
die"cannot connect to slapd"if ++$retries >= 300;
135+
note"waiting for slapd to accept requests...";
136+
Time::HiRes::usleep(1000000);
137+
}
138+
123139
$ENV{'LDAPURI'} =$ldap_url;
124140
$ENV{'LDAPBINDDN'} =$ldap_rootdn;
125141
$ENV{'LDAPCONF'} =$ldap_conf;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp