ZhengweiZhu opened a new pull request, #3448:
URL: https://github.com/apache/brpc/pull/3448

   ### What problem does this PR solve?
   
   Issue Number: N/A
   
   Problem Summary:
   
   `brpc_controller_unittest` may fail under LeakSanitizer with a 110-byte leak 
report after the root client span tests. The spans have already been submitted 
to the asynchronous bvar collector, but the short-lived test process can exit 
before the collector releases its references.
   
   ### What is changed and the side effects?
   
   Changed:
   
   - Add a bounded `WaitForSpanToExpire` helper that polls the test's 
`weak_ptr` for at most 5 seconds.
   - Wait for asynchronous span collection after both `Controller::Reset` and 
`Controller::SubmitSpan`.
   - Assert the observable lifetime contract instead of suppressing 
LeakSanitizer reports for all span factory allocations.
   
   Validation:
   
   - `git diff --check` passes.
   - The Linux ASAN unit test was not run locally because this checkout does 
not have a configured Bazel/Make build environment. The pull request CI will 
provide the ASAN verification.
   
   Side effects:
   - Performance effects: Test-only. The two affected tests normally wait for 
approximately one collector interval and fail after a 5-second deadline if 
collection does not complete.
   - Breaking backward compatibility: None.
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


-- 
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