Commit 52ba50b2 authored by Sky Malice's avatar Sky Malice Committed by Commit Bot

Revert "network: de-flake NetworkQualityEstimator throttling test"

This reverts commit 342a65b7.

Reason for revert: Test failure https://ci.chromium.org/p/chromium/builders/ci/android-pie-x86-rel/2559

Original change's description:
> network: de-flake NetworkQualityEstimator throttling test
>
> This test has is flaky when run on devices that have a real wifi or
> cellular connection, because in that situation, the call to
> SimulateNetworkChange() can cause an arbitrary number of real calls
> to GetCurrentSignalStrengthWithThrottling(). This change de-flakes
> the test in that situation by:
>
> 1) Delaying constructing the HistogramTester, to avoid counting
>    those calls, and
> 2) Advancing the fake time the test uses at the start of the test,
>    so that the NetworkQualityEstimator under test is never in its
>    timeout period when the test starts
>
> This change also re-enables the test on Android, since this should
> de-flake the test there too.
>
> Bug: 1133439,1130720
> Change-Id: I4164ce4bb105082fe58382c3f7c72b5b9462a8ab
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2476812
> Reviewed-by: Tarun Bansal <tbansal@chromium.org>
> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#817719}

TBR=ellyjones@chromium.org,tbansal@chromium.org

Change-Id: Id4bd9253500cd585a1ce38fd49b5fcae6db7c555
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1133439
Bug: 1130720
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2482084Reviewed-by: default avatarSky Malice <skym@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818142}
parent 3bff4f72
...@@ -3062,30 +3062,30 @@ TEST_F(NetworkQualityEstimatorTest, TestPeerToPeerConnectionsCountObserver) { ...@@ -3062,30 +3062,30 @@ TEST_F(NetworkQualityEstimatorTest, TestPeerToPeerConnectionsCountObserver) {
EXPECT_EQ(3u, observer.count()); EXPECT_EQ(3u, observer.count());
} }
// Fails only for Android. https://crbug.com/1130720
#if defined(OS_ANDROID)
#define MAYBE_CheckSignalStrength DISABLED_CheckSignalStrength
#else
#define MAYBE_CheckSignalStrength CheckSignalStrength
#endif
// Tests that the signal strength API is not called too frequently. // Tests that the signal strength API is not called too frequently.
TEST_F(NetworkQualityEstimatorTest, CheckSignalStrength) { TEST_F(NetworkQualityEstimatorTest, MAYBE_CheckSignalStrength) {
base::HistogramTester histogram_tester;
constexpr char histogram_name[] = "NQE.SignalStrengthQueried.WiFi"; constexpr char histogram_name[] = "NQE.SignalStrengthQueried.WiFi";
constexpr int kWiFiSignalStrengthQueryIntervalSeconds = 30 * 60; constexpr int kWiFiSignalStrengthQueryIntervalSeconds = 30 * 60;
std::map<std::string, std::string> variation_params; std::map<std::string, std::string> variation_params;
variation_params["get_signal_strength_and_detailed_network_id"] = "true"; variation_params["get_signal_strength_and_detailed_network_id"] = "true";
TestNetworkQualityEstimator estimator(variation_params); TestNetworkQualityEstimator estimator(variation_params);
estimator.SimulateNetworkChange( estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test"); NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test");
base::SimpleTestTickClock tick_clock; base::SimpleTestTickClock tick_clock;
// SimulateNetworkChange() above can produce entries in the histogram bucket tick_clock.SetNowTicks(base::TimeTicks::Now());
// if the test system has real wifi or cellular connections, and can also
// leave the NQE inside its timeout. To avoid that, fastforward fake time for
// more than the query interval.
tick_clock.SetNowTicks(base::TimeTicks::Now() +
base::TimeDelta::FromSeconds(
kWiFiSignalStrengthQueryIntervalSeconds * 2));
estimator.SetTickClockForTesting(&tick_clock); estimator.SetTickClockForTesting(&tick_clock);
base::HistogramTester histogram_tester;
base::Optional<int32_t> signal_strength = base::Optional<int32_t> signal_strength =
estimator.GetCurrentSignalStrengthWithThrottling(); estimator.GetCurrentSignalStrengthWithThrottling();
......
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