Commit 42e2e9c0 authored by Yao Xiao's avatar Yao Xiao Committed by Commit Bot

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: default avatarJosh Karlin <jkarlin@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823612}
parent d5d6b433
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment