shuke987 opened a new pull request, #65757:
URL: https://github.com/apache/doris/pull/65757

   ### What problem does this PR solve?
   
   Backport the test stabilization from #65587 to `branch-4.1`.
   
   `BDBEnvironmentTest.testReadTxnIsNotMatched` used a partial JMockit 
expectation on the live JE `RepImpl`. On release branches this can miss or 
intercept `registerVLSN` calls inconsistently, causing `MissingInvocation` 
failures. The test also read follower state immediately after the master write, 
racing asynchronous replication.
   
   ### What is changed?
   
   - Wait until the committed baseline value is visible on followers.
   - Replace the method-local JMockit expectation with a Mockito spy that 
throws only from `postLogCommitHook`, after the transaction has committed 
locally.
   - Install the spy in both JE environment fields and restore the original 
`RepImpl` in `finally`.
   - Verify the exact locally committed value after reopening the former master.
   
   This is a tailored pick because `branch-4.1` still has the older 
JMockit-based test structure.
   
   ### Check List
   
   - [x] Target FE UT passed twice locally.
   - [x] `git diff --check` passed.
   
   ### Tests
   
   - `./run-fe-ut.sh --run 
'org.apache.doris.journal.bdbje.BDBEnvironmentTest#testReadTxnIsNotMatched'`
   - `mvn test -Dskip.clean=true -Dcheckstyle.skip=true -DfailIfNoTests=false 
-Dtest='org.apache.doris.journal.bdbje.BDBEnvironmentTest#testReadTxnIsNotMatched'`
   
   Related: #65587
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to