-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-13798 TestFromClientSide* don't close the Table (branch-2) #289
Conversation
💔 -1 overall
This message was automatically generated. |
Nice cleanup @anmolnar Mind force pushing to retrigger build checks? Seems like that is how folks are doing PR re-check (asking...). The patch failed unrelated tests in hbase-server.... which must be unrelated given this just a test refactor. Thanks. |
I started a new build now. |
💔 -1 overall
This message was automatically generated. |
Thanks @petersomogyi That worked. Let me try redoing the checks..... So I can document it and know what I'm talking about. |
💔 -1 overall
This message was automatically generated. |
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.
Change looks very good!
I have 2 comments, similar ones can be found in a few other test cases, but I don't think we need to modify those in this change.
long [] ts = {1000, 2000, 3000, 4000, 5000}; | ||
|
||
Table ht = TEST_UTIL.createTable(tableName, FAMILY, 5); | ||
try (Admin admin = TEST_UTIL.getAdmin()) { |
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.
@Apache9 mentioned on master PR that Admin shouldn't be closed. In this case I'd prefer to keep try-with-resource since that's what we have on master and original version explicitly closed admin.
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.
If the TEST_UTIL is not created per test, but is setup once only for all tests, then indeed, closing the Admin made by TEST_UTIL will mess up subsequent attempts at using admin.
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.
@petersomogyi Sorry I missed that TEST_UTIL actually stores and maintains the Admin. It should not be closed from tests, but from your comment I cannot decide whether I change it here or just leave, because it's a backport.
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 we can have this change like this to be consistent between master and branch-2 and fix the Admin closes in a different ticket since that is required on master as well.
if (ts[j].getTableName().equals(tables[i])) { | ||
found = true; | ||
break; | ||
try (Admin admin = TEST_UTIL.getAdmin()) { |
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.
Same here, however, it wasn't closed previously.
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.
There're also a few places in TestFromClientSide3
which missed the refactoring and not closing the Admin.
If new patch, mind addressing the checkstyle issue @anmolnar ? Thanks. |
Checks run #3 shows TestProcedure failing which is not realted to changes in here. Just saying. |
@saintstack Thanks, I will fix checkstyle issues. |
💔 -1 overall
This message was automatically generated. |
this still active? |
@busbey Yes. I'm still on holiday, but will come back to this next week. |
💔 -1 overall
This message was automatically generated. |
@petersomogyi @busbey Most of checkstyle issues have been addressed, unit tests are green. |
This is the
branch-2
backport of master patch: 7878389