Figure out what's going on with network_time_test_utils needing to reset a null pointer |
||||
Issue descriptionnetwork_time::FieldTrialTest needs to reset its (null) field_trial_list_ before instantiating it, to avoid hitting a DCHECK [1]. I'm pretty sure we're doing something wrong here, since we shouldn't need to reset a null pointer before assigning to it. So, we should figure out what that reset is doing and why we need it and how to get rid of it. [1] https://cs.chromium.org/chromium/src/base/metrics/field_trial.cc?q=%22DCHECK(!global_)%22&sq=package:chromium&l=492
,
Jan 24 2017
,
Jan 24 2017
Is it possible that one of the test classes have multiple field_trial_list members (e.g. one of them coming from the base class) that initialize the field trials? FieldTrialList documentation says there should be only one instance of it. Perhaps network_time_test_utils should first try to find an existing one before creating anew?
,
Jan 24 2017
Re #3: it does seem like there must be a FieldTrialList being created somewhere unexpected... it's not obvious where though. The test fixtures themselves don't seem to create FieldTrialLists. It wouldn't surprise me if something somewhere was creating an additional FieldTrialList, but it does surprise me that resetting a null pointer does anything at all. Does that make any sense to you?
,
Jan 24 2017
It looks like the constructor is called twice through FieldTrialTest::SetNetworkQueriesWithVariationsService, once in NetworkTimeTrackerTest and then in the tests (e.g. NetworkTimeTrackerTest, StartTimeFetchWithoutVariationsParam). Removing SetNetworkQueriesWithVariationsService call from NetworkTimeTrackerTest obviates the need for the null hack, but then you'll need to call it separately in each test. You could also keep the reset(nullptr) code and then add a comment saying why it's needed.
,
Jun 7 2017
Thanks for figuring out what was going on, meacer!
,
Jun 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f397511c435587def5e9d55a2d26a23324f89956 commit f397511c435587def5e9d55a2d26a23324f89956 Author: estark <estark@chromium.org> Date: Thu Jun 08 18:28:57 2017 Update a comment in network time test helper BUG= 684216 Review-Url: https://codereview.chromium.org/2930613002 Cr-Commit-Position: refs/heads/master@{#478031} [modify] https://crrev.com/f397511c435587def5e9d55a2d26a23324f89956/components/network_time/network_time_test_utils.cc
,
Jun 8 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by est...@chromium.org
, Jan 24 2017