thread leakage checker and memory usage reporter #1226#1452
thread leakage checker and memory usage reporter #1226#1452jiajunwang merged 6 commits intoapache:masterfrom
Conversation
Add thread leakage checker and memory usage reporter. The two utility would be invoke before and after test classes. The would help to detect/monitor resource/memory usage of the unit test.
helix-core/src/test/java/org/apache/helix/common/ZkTestBase.java
Outdated
Show resolved
Hide resolved
|
Are we targeting to output the memory usage after each test class? Will this PR make it happen? |
helix-core/src/test/java/org/apache/helix/ThreadLeakageChecker.java
Outdated
Show resolved
Hide resolved
Currently, all the ones using ZkTestBase. Since the majority use ZkTestBase, we have a good idea of the memory usage over time. |
|
The PR is approved, please help to merge in.
|
helix-core/src/test/java/org/apache/helix/common/ZkTestBase.java
Outdated
Show resolved
Hide resolved
helix-core/src/test/java/org/apache/helix/ThreadLeakageChecker.java
Outdated
Show resolved
Hide resolved
helix-core/src/test/java/org/apache/helix/common/ZkTestBase.java
Outdated
Show resolved
Hide resolved
helix-core/src/test/java/org/apache/helix/common/ZkTestBase.java
Outdated
Show resolved
Hide resolved
helix-core/src/test/java/org/apache/helix/integration/multizk/TestMultiZkHelixJavaApis.java
Outdated
Show resolved
Hide resolved
jiajunwang
left a comment
There was a problem hiding this comment.
Still, 2 problems that I also mentioned in the other test improvement PRs.
- What is the guideline for using a system print vs. log? Without confirming this point, I cannot review it effectively. I prefer log, BTW.
- Why not throw an exception on leakage? If just print error, then we can just let the tool runs every night. There is no need to do it with every "mvn test".
For example, if people ignore the error, then we might figure it out weeks later. Then this check will be very less helpful.
If we throw exception, current test won't work. I reduced the threads leakage from around 3000 to several hundreds at this point. Getting it to 0 is still some way to go. |
|
Sync-ed with JJ offline. Once the thread leakage reduced to 0. We will enable the throw exception (failing test). Before that, we use system.out to log it out for people to examine without enable info level logging |
|
The PR is approved. Please help to merge to trunk
|
Issues
fix #1226
Description
Add thread leakage checker and memory usage reporter. The two
utility would be invoke before and after test classes. The would
help to detect/monitor resource/memory usage of the unit test.
Tests
(List the names of added unit/integration tests)
2020-10-08T07:55:24.0931119Z
2020-10-08T07:55:24.4922133Z [ERROR] Failures:
2020-10-08T07:55:24.4923510Z [ERROR] TestDisableCustomCodeRunner.test:236 expected: but was:
2020-10-08T07:55:24.4925729Z [ERROR] TestClusterStatusMonitorLifecycle.testClusterStatusMonitorLifecycle:290 expected: but was:
2020-10-08T07:55:24.4928050Z [ERROR] Tests run: 1213, Failures: 2, Errors: 0, Skipped: 0
re-run would work.
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)