pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][flaky-test]TxnLogBufferedWriterTest.testMainProcess

Open poorbarcode opened this issue 3 years ago • 1 comments

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 ArrayList causes the 'list.size()' to return incorrect results, leading to Awaitility.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)

poorbarcode avatar Aug 08 '22 18:08 poorbarcode

/pulsarbot rerun-failure-checks

poorbarcode avatar Aug 10 '22 06:08 poorbarcode