Adar Dembo has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/12820 )

Change subject: KUDU-2687: fix ITClient retries (take two)
......................................................................

KUDU-2687: fix ITClient retries (take two)

After adding randomly injected failures, I finally figured out why ITClient
retries were broken: because, surprisingly, the RetryRule does _not_
reinitialize non-static test class fields. As such, the latches' counts were
never reset, and so every test retry would immediately fail.

Along the way I improved the test in a few ways:
- Switched from two latches to just one.
- Ensured that the test cleaned up its threads on failure.
- Made the test throw the failing exception directly rather than logging it
  and forcing you to scroll around looking for the logged message.
- Switched from Random to RandomUtils.
- Relatedly, fixed the reuse of CapturingLogAppender in TestSecurity, which
  caused every test to capture the events of all tests that ran before it.

Change-Id: I31ec2d708d0ed41f25abcf09011967062c9a56c6
Reviewed-on: http://gerrit.cloudera.org:8080/12820
Reviewed-by: Grant Henke <[email protected]>
Tested-by: Kudu Jenkins
---
M java/kudu-client/src/test/java/org/apache/kudu/client/ITClient.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurity.java
2 files changed, 41 insertions(+), 26 deletions(-)

Approvals:
  Grant Henke: Looks good to me, approved
  Kudu Jenkins: Verified

--
To view, visit http://gerrit.cloudera.org:8080/12820
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I31ec2d708d0ed41f25abcf09011967062c9a56c6
Gerrit-Change-Number: 12820
Gerrit-PatchSet: 4
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Will Berkeley <[email protected]>

Reply via email to