You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/10/09 13:46:33 UTC

[PR] [ISSUE #11336] test(remoting): cover SemaphoreReleaseOnlyOnce exactly-once contract [rocketmq]

chennaji9 opened a new pull request, #11345:
URL: https://github.com/apache/rocketmq/pull/11345

   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   Fixes #11336
   
   ### Brief Description
   
   Adds `SemaphoreReleaseOnlyOnceTest` with direct coverage of the class's exactly-once release contract, which currently has no dedicated test:
   
   - 8 threads released simultaneously (CyclicBarrier) on the same holder add **exactly one** permit — the timeout-vs-callback race the CAS guard exists for;
   - repeated sequential releases add no further permits;
   - a null semaphore is a silent no-op (no NPE), matching how the class is constructed for unlimited (`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`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #11336] test(remoting): cover SemaphoreReleaseOnlyOnce exactly-once contract [rocketmq]

Posted by "chennaji9 (via GitHub)" <gi...@apache.org>.
chennaji9 commented on PR #11345:
URL: https://github.com/apache/rocketmq/pull/11345#issuecomment-6259357947

   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!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #11336] test(remoting): cover SemaphoreReleaseOnlyOnce exactly-once contract [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #11345:
URL: https://github.com/apache/rocketmq/pull/11345#issuecomment-6083276173

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/11345?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 49.66%. Comparing base ([`9ea2ccd`](https://app.codecov.io/gh/apache/rocketmq/commit/9ea2ccdc2b41445aee5e177e14e501d606f5a1ed?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e46651e`](https://app.codecov.io/gh/apache/rocketmq/commit/e46651e523b3a3e49fd91d833122c84a156f70ab?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              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     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/rocketmq/pull/11345?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org