pulsar
pulsar copied to clipboard
[fix][flaky-test]TxnLogBufferedWriterTest.testMainProcess
Fixes #16989, #16723
Master Issue: #16989, #16723
Motivation
- #16989: We mocked a BK error, but if an exception occurs, the failure callback will be executed earlier. So the results of the callbacks will be out of order, and mismatch occur.
- #16723: I'm sorry, but after PR #16982 I found another reason makes unit test flaky, Multi threads access to
ArrayListcauses the 'list.size()' to return incorrect results, leading toAwaitility.await().until(() -> contextArrayOfCallback.size() == writeCmdExecuteCount)cannot end.
Modifications
- #16989: If we mocked BK errors, sort the callback results.
- #16723: Make collection objects to thread safety.
- Remove unstable assertions. I will rewrite these two cases after PR #16758, because that PR has really changed a lot
Assert.assertTrue(exceptionCallbackCount > 0);
Assert.assertTrue(positionCallbackCount > 0);
Documentation
-
[ ]
doc-required(Your PR needs to update docs and you will update later) -
[x]
doc-not-needed(Please explain why) -
[ ]
doc(Your PR contains doc changes) -
[ ]
doc-complete(Docs have been already added)
/pulsarbot rerun-failure-checks