Skip to content

HBASE-29828 Upgrade TestIPC related tests to junit5 - #7626

Merged
Apache9 merged 1 commit into
apache:masterfrom
Apache9:HBASE-29828
Jan 17, 2026
Merged

HBASE-29828 Upgrade TestIPC related tests to junit5#7626
Apache9 merged 1 commit into
apache:masterfrom
Apache9:HBASE-29828

Conversation

@Apache9

Copy link
Copy Markdown
Contributor

No description provided.

@Apache9
Apache9 requested a review from ndimidukJanuary 15, 2026 03:36
@Apache9Apache9 self-assigned this Jan 15, 2026
@Apache9

Copy link
Copy Markdown
ContributorAuthor

While rewriting and debugging, I found a possible problem is that, for testTimeout and testAsyncTimeout, when the test method finishes, the rpc call is still executing(sleeping), so when it finishes, it will record a tracing span in the global opentelemetry instance.

In JUnit4, since we always reset the global opentelemetry instance, so this may cause exception describe there. And in JUnit5, we do not reset the global instance but the timeout call may add new spans after we clear all the spans for the previous test and cause the next test to fail because of unexpected spans.

So the main fix is that, I added a check before shutting down the rpc server in testTimeout and testAsyncTimeout, to wait until all the pending calls are finished. In this way I think the test will be more stable.

@ndimiduk FYI.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 29sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+1 💚mvninstall3m 29smaster passed
+1 💚compile3m 30smaster passed
+1 💚checkstyle1m 1smaster passed
+1 💚spotbugs1m 40smaster passed
+1 💚spotless0m 52sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 10sthe patch passed
+1 💚compile3m 26sthe patch passed
+1 💚javac3m 26sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle1m 0sthe patch passed
+1 💚spotbugs1m 45sthe patch passed
+1 💚hadoopcheck12m 8sPatch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚spotless0m 47spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 12sThe patch does not generate ASF License warnings.
41m 21s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7626/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#7626
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 45230e037c07 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 62a3b54
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count84 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7626/1/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 30sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall3m 31smaster passed
+1 💚compile1m 0smaster passed
+1 💚javadoc0m 30smaster passed
+1 💚shadedjars6m 2sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 13sthe patch passed
+1 💚compile1m 2sthe patch passed
+1 💚javac1m 2sthe patch passed
+1 💚javadoc0m 28sthe patch passed
+1 💚shadedjars5m 58spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit236m 44s/patch-unit-hbase-server.txthbase-server in the patch failed.
264m 23s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7626/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#7626
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 47c68c1a5f10 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 62a3b54
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7626/1/testReport/
Max. process+thread count3720 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7626/1/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@ndimidukndimiduk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern from OTEL is annoying.

Just for a counter-idea, what if we add a notification mechanism to TestProtobufRpcServiceImpl#pause() , the test method registers a Future that is completed on the way out of the method.

}
} finally {
// wait until all active calls quit, otherwise it may mess up the tracing spans
await().atMost(Duration.ofSeconds(2))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate to bring it up, but would 5 sec be more reliable in our CI?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout value is 1 secs, so I think 2 secs is enough?

@Apache9

Copy link
Copy Markdown
ContributorAuthor

This pattern from OTEL is annoying.

Just for a counter-idea, what if we add a notification mechanism to TestProtobufRpcServiceImpl#pause() , the test method registers a Future that is completed on the way out of the method.

Our rpc implementation does not support this...
The timeout config is at client side, so when we reach the timeout, the client side will get a RpcTimeoutException immediately, and the call entry will be removed. Later when we receive the response from server side, we will just drop it since we can not find the call entry for this call...

@ndimiduk

Copy link
Copy Markdown
Member

I was thinking just for the purpose of keeping the test reliable. It's all within the same process, so the main test thread would wait until notified by the end of the pause. Complete the future within a finally block and it should be enough.

But maybe my understanding here is superficial.

Thanks for digging here Duo.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

I was thinking just for the purpose of keeping the test reliable. It's all within the same process, so the main test thread would wait until notified by the end of the pause. Complete the future within a finally block and it should be enough.

But maybe my understanding here is superficial.

Thanks for digging here Duo.

Rpc calls run in a thread pool at server side, and we will use the same process to run all the test methods, so there is no simple way for us to wait in main thread. We can think the current fix in this PR is to make the main thread join on the thread pool for running rpc calls at server side...

@Apache9
Apache9 merged commit 2c8d1c0 into apache:masterJan 17, 2026
1 check failed
Apache9 added a commit that referenced this pull request Jan 17, 2026
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
(cherry picked from commit 2c8d1c0)
Apache9 added a commit that referenced this pull request Jan 17, 2026
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
(cherry picked from commit 2c8d1c0)
Apache9 added a commit that referenced this pull request Jan 17, 2026
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
(cherry picked from commit 2c8d1c0)
Apache9 added a commit that referenced this pull request Jan 17, 2026
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
(cherry picked from commit 2c8d1c0)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Apache9@Apache-HBase@ndimiduk