Fix data races in the floc unittests
2 tests were disabled recently as they were flaky on builder "Linux TSan Tests". That's because when the tests finish, there is still a pending history query, and on the history backend thread there is a check for the feature kHideFromApi3Transitions (also introduced recently). If the check occurs after the ScopedFeatureList is destroyed, then there is a data race and would fail the sanitizer. This CL moves the |feature_list_| member to the test class before the |history_service_| member, and initialize it in the test constructor. This ensures it will only be destroyed only after |history_service_| is destroyed. This CL also removes the FlocIdComputedEventLogging feature initialization in the test, as it's already enabled by default. Bug: 1143855 Change-Id: I6b7141a0bf9000ac453768828be1d6a35218a079 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2512846Reviewed-by:Josh Karlin <jkarlin@chromium.org> Commit-Queue: Yao Xiao <yaoxia@chromium.org> Cr-Commit-Position: refs/heads/master@{#823612}
Showing
This diff is collapsed.
Please register or sign in to comment