Michael Smith has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/23861


Change subject: IMPALA-14678: Fix retries in testHiveserver2SharedCookie
......................................................................

IMPALA-14678: Fix retries in testHiveserver2SharedCookie

This test had a few mistakes. It would never retry the last case because
the Exception that's supposed to trigger retry - when OpenSession
succeeds - would be caught and returned instead, which led to

    expected:<[Expected failure due to changed cookie secret.]>
    but was:<[HTTP Response code: 401]>

This worked most of the time because the cookie reload is fast, and
usually the first request fails with an invalid cookie.

After fixing that issue, I ran into another. Apache HttpClient makes it
easy to re-use connections. In testHiveserver2SharedCookie, we keep
retrying until cookie authentication fails. If it instead succeeds, all
subsequent attempts re-used the same connection and never actually
retried cookie authentication, so we would time out.

Fixes THttpClient retries in testHiveserver2SharedCookie test. Moves the
retry exception out of try/catch and uses a new client for each request
to avoid connection re-use. Also fixes expected in assertEquals.

Tested by running the test 40 times without failure.

Change-Id: Icaccc6fcc4529fe9a93ede97ca5130644e88c439
---
M fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java
1 file changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/61/23861/1
--
To view, visit http://gerrit.cloudera.org:8080/23861
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaccc6fcc4529fe9a93ede97ca5130644e88c439
Gerrit-Change-Number: 23861
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <[email protected]>

Reply via email to