Impala Public Jenkins has submitted this change and it was merged. ( 
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
Reviewed-on: http://gerrit.cloudera.org:8080/23861
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M fe/src/test/java/org/apache/impala/customcluster/LdapHS2Test.java
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
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: merged
Gerrit-Change-Id: Icaccc6fcc4529fe9a93ede97ca5130644e88c439
Gerrit-Change-Number: 23861
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Smith <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to