[Security][Tests] Print LDAP reconnect stacktrace on fail

Original commit: elastic/x-pack-elasticsearch@18f235197c
This commit is contained in:
Albert Zaharovits 2018-02-07 21:34:28 +02:00
parent bce8d6f9e6
commit a57999e1e1
2 changed files with 8 additions and 2 deletions

View File

@ -9,6 +9,8 @@ import com.unboundid.ldap.sdk.LDAPConnection;
import com.unboundid.ldap.sdk.LDAPConnectionPool;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.LDAPInterface;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.TestEnvironment;
@ -100,7 +102,8 @@ public class AbstractActiveDirectoryIntegTests extends ESTestCase {
}
}
} catch (LDAPException e) {
fail("Connection is not valid. It will not work on follow referral flow.");
fail("Connection is not valid. It will not work on follow referral flow." +
System.lineSeparator() + ExceptionsHelper.stackTrace(e));
}
return null;
}

View File

@ -12,6 +12,8 @@ import com.unboundid.ldap.sdk.LDAPConnectionPool;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.LDAPInterface;
import com.unboundid.ldap.sdk.LDAPURL;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.SecureString;
@ -182,7 +184,8 @@ public abstract class LdapTestCase extends ESTestCase {
}
}
} catch (LDAPException e) {
fail("Connection is not valid. It will not work on follow referral flow.");
fail("Connection is not valid. It will not work on follow referral flow." +
System.lineSeparator() + ExceptionsHelper.stackTrace(e));
}
return null;
}