[ 
https://issues.apache.org/jira/browse/IMPALA-14678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051569#comment-18051569
 ] 

ASF subversion and git services commented on IMPALA-14678:
----------------------------------------------------------

Commit 492745af66b35ca812908be291eb524e6a337c81 in impala's branch 
refs/heads/master from Michael Smith
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=492745af6 ]

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]>


> testHiveserver2SharedCookie is flaky
> ------------------------------------
>
>                 Key: IMPALA-14678
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14678
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 5.0.0
>            Reporter: Zoltán Borók-Nagy
>            Assignee: Michael Smith
>            Priority: Major
>              Labels: broken-build
>
> Saw this in a few builds:
> h3. Error Message
> {noformat}
> expected:<[Expected failure due to changed cookie secret.]> but was:<[HTTP 
> Response code: 401]>{noformat}
> h3. Stacktrace
> {noformat}
> org.junit.ComparisonFailure: expected:<[Expected failure due to changed 
> cookie secret.]> but was:<[HTTP Response code: 401]>
>       at org.junit.Assert.assertEquals(Assert.java:115)
>       at org.junit.Assert.assertEquals(Assert.java:144)
>       at 
> org.apache.impala.customcluster.LdapHS2Test.testHiveserver2SharedCookie(LdapHS2Test.java:1070)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to