You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "zxxwyt (via GitHub)" <gi...@apache.org> on 2026/10/17 14:20:21 UTC
[PR] test: verify buffer state transitions and mark semantics [incubator-seata]
zxxwyt opened a new pull request, #8305:
URL: https://github.com/apache/incubator-seata/pull/8305
- [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
- [x] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
### Ⅰ. Describe what this PR did
`BufferUtilsTest` currently only checks that its seven wrapper methods do not throw. For example, removing `flip` would leave the buffer in write mode while its test still passes.
Replace those checks with 10 parameterized tests (30 cases) using heap ByteBuffer, direct ByteBuffer and CharBuffer. Assert position, limit, capacity, mark replacement/preservation/invalidation, and invalid position/limit/reset behavior. Production code is unchanged.
### Ⅱ. Does this pull request fix one issue?
No specific issue; this strengthens the existing unit tests.
### Ⅲ. Why don't you add test cases (unit test/integration test)?
This PR changes unit tests only, plus the English and Chinese changelogs. All fixtures use in-memory JDK buffers.
### Ⅳ. Describe how to verify it
On JDK 17, all 30 cases pass with zero failures, errors or skips after a clean build. Full-repository Spotless and the changed test's Checkstyle checks pass.
```sh
./mvnw -pl common -am -Dtest=BufferUtilsTest -Dsurefire.failIfNoSpecifiedTests=false test
./mvnw spotless:check
./mvnw -pl common checkstyle:check -Dcheckstyle.skip=false -Dcheckstyle.includes=**/BufferUtilsTest.java
```
Mutation check: making flip, clear, limit, position, rewind and reset no-ops together still passes the original seven tests. With the new tests, each of these six no-op mutations is detected independently. All temporary production mutations were restored before the final test run.
### Ⅴ. Special notes for reviews
This improves behavioral assertions; it does not claim increased line coverage or Java 8 runtime validation. The wrappers continue to operate through `java.nio.Buffer`, and the tests use Java 8 APIs.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] test: verify buffer state transitions and mark semantics [incubator-seata]
Posted by "WangzJi (via GitHub) via notifications" <no...@seata.apache.org>.
WangzJi commented on PR #8305:
URL: https://github.com/apache/incubator-seata/pull/8305#issuecomment-7073800948
@zxxwyt Plz resolve the conflicts.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] test: verify buffer state transitions and mark semantics [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8305:
URL: https://github.com/apache/incubator-seata/pull/8305#issuecomment-6235360001
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8305?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 79.91%. Comparing base ([`8a31b1f`](https://app.codecov.io/gh/apache/incubator-seata/commit/8a31b1f41da325f5b498d3fa2853221620388d35?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7390790`](https://app.codecov.io/gh/apache/incubator-seata/commit/7390790117cc8297f010285b0231cdc3086eca9a?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 @@
## 2.x #8305 +/- ##
=========================================
Coverage 79.91% 79.91%
Complexity 1165 1165
=========================================
Files 1400 1400
Lines 53011 53011
Branches 6349 6349
=========================================
Hits 42365 42365
- Misses 7695 7697 +2
+ Partials 2951 2949 -2
```
[see 11 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8305/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
[](https://app.codecov.io/gh/apache/incubator-seata/pull/8305?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<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.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org