Repository navigation
Conversation
…xactly-once contract Add SemaphoreReleaseOnlyOnceTest: an 8-thread barrier race on the same holder must add exactly one permit, sequential re-releases add none, and a null semaphore stays a silent no-op.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11345 +/- ##
=============================================
- Coverage 49.73% 49.66% -0.08%
+ Complexity 14348 14329 -19
=============================================
Files 1390 1390
Lines 103246 103246
Branches 13502 13502
=============================================
- Hits 51354 51277 -77
- Misses 45696 45763 +67
- Partials 6196 6206 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot
Summary
Adds SemaphoreReleaseOnlyOnceTest pinning the exactly-once release contract of the remoting semaphore wrapper.
Findings
- [Info]
SemaphoreReleaseOnlyOnceTest.java— Three tests: sequential release (only one permit added), concurrent release (8 threads, still exactly one permit), and null semaphore safety. TheCyclicBarriercoordination for the concurrent test is correct. - [Info] The null-semicolon test ensures no NPE, which is a valid edge case.
Suggestions
- None. Clean and well-structured.
Automated review by github-manager-bot
e46651e to
b52c299
Compare
|
Hi @RongtongJin, sorry for the ping — this PR has been open for a while without a review yet. The change is small and focused (cover SemaphoreReleaseOnlyOnce exactly-once contract), and all tests and CI pass on my side. Would you mind taking a look when you get a chance? If it looks good, merging it would be much appreciated — happy to adjust anything if needed. Thanks a lot! |
Which Issue(s) This PR Fixes
Fixes #11336
Brief Description
Adds
SemaphoreReleaseOnlyOnceTestwith direct coverage of the class's exactly-once release contract, which currently has no dedicated test:null) semaphores.Test-only change; no production code touched.
How Did You Test This Change?
mvn -pl remoting -Dtest=SemaphoreReleaseOnlyOnceTest -Dsurefire.failIfNoSpecifiedTests=false test(JDK 11, PR base commit):Tests run: 3, Failures: 0, Errors: 0.