HBASE-13798 TestFromClientSide* don't close the Table (branch-2)#289
HBASE-13798 TestFromClientSide* don't close the Table (branch-2)#289petersomogyi merged 2 commits intoapache:branch-2from
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. |
petersomogyi
left a comment
There was a problem hiding this comment.
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.
@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.
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.
@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.
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.
Same here, however, it wasn't closed previously.
There was a problem hiding this comment.
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-2backport of master patch: 7878389