-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23970 TestUsersOperationsWithSecureHadoop fails when an existing ticket is present #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
ndimiduk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question -- is it okay that we delete existing tickets? Shouldn't the test work by isolating itself to the realm of the test, ignoring other tickets that might be present?
| public static void destroyAndSetup() throws Exception { | ||
| //destroy localhost kerberos users | ||
| Process process = Runtime.getRuntime().exec(new String[]{"bash", "-c", "kdestroy"}); | ||
| process.waitFor(2, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This previous waitFor call doesn't check the return value. It's possible the call failed but the test didn't notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the previous exec w/ its kdestroy is better than klist with a 'notice' IMO. What tends to happen is you run test suite and then one hour in, it will fail with complaint about unmatched user for old ticket. WIth kdestroy, that doesn't happen. Means old ticket gets killed which should be fine most of the time -- you just re-kinit (unless you running test suite on some critical system).
Nick's idea of narrowing test so it only concerned about test ticket would be best. Not sure how to do that though myself.
| public static void checkAndSetup() throws Exception { | ||
| // check localhost kerberos users | ||
| Process process = Runtime.getRuntime().exec(new String[]{"bash", "-c", "klist"}); | ||
| boolean wait = process.waitFor(2, TimeUnit.SECONDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a simple assertTrue is sufficient for this case.
|
@ndimiduk noticed that some of this patch got accidentally committed as part of https://github.com/apache/hbase/pull/1278/files Let me revert that piece. I had this issue myself today. Its a pain. Lets get a fix in. I like Nick's idea of confining deletion to test realm but not sure its possible; would be cool if it was. |
|
I removed the overcommit to TestUsersOperationsWithSecureHadoop with the below push on master commit 9804f73 (HEAD -> m, origin/master, origin/HEAD) |
|
💔 -1 overall
This message was automatically generated. |
1 similar comment
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
ndimiduk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits. Have an updated patch for us @WenFeiYi ? I'd like to get this in.
| boolean wait = process.waitFor(2, TimeUnit.SECONDS); | ||
| assertTrue("localhost exec klist timeout!", wait); | ||
| int ret = process.exitValue(); | ||
| assertTrue("localhost have an existing ticket!",ret != 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about about assertNotEquals instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks. I commit on a new branch
No description provided.