Ren Koike created HDDS-16266:
--------------------------------

             Summary: Add mock-based unit tests for Ratis write path
                 Key: HDDS-16266
                 URL: https://issues.apache.org/jira/browse/HDDS-16266
             Project: Apache Ozone
          Issue Type: Improvement
          Components: Ozone Client
            Reporter: Ren Koike
            Assignee: Ren Koike


Extend the mock-based testing approach to the Ratis write path 
({*}RatisBlockOutputStream{*} / {*}KeyOutputStream{*}).

The Ratis path is simpler to mock than *DataStream* because *XceiverClientSpi* 
is abstract (not final), so a concrete *MockXceiverClientSpi* subclass works 
without Mockito-inline. An existing *MockXceiverClientSpi* in 
*TestBlockOutputStreamCorrectness* already proves this pattern works.

New files:
- *FakeRatisPipeline* test harness with failure injection for writeChunk, 
putBlock, and watchForCommit.
- {*}TestRatisBlockOutputStreamUnit{*}.java — block-level tests covering 
write+close, flush, hsync, putBlock failure, watchForCommit failure, 
writeOnRetry, and data integrity.
- {*}TestKeyOutputStreamUnit{*}.java — key-level tests covering write+commit, 
cross-block-boundary allocation, hsync-to-OM, container-close retry, and atomic 
key size.

All tests should pass on current code — the Ratis hsync correctly propagates 
exceptions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to