Mark FakeLatencyTracker as flaky

DeviceConfig callbacks often block indef and cause test module timeouts.

Add a test timeout for this class and mark them as flaky to take out of
presubmit.

TODO: 275746222 - don't rely on these callbacks, and instead mock/fake
the config, since it isn't related to what we are testing.

Bug: 287361279
Bug: 289392471
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4cb6557aa21727a7fc2023dc6575181acdbff953)
Merged-In: I603ebe0ceac23335248a8cdb299d52829b55536a
Change-Id: I603ebe0ceac23335248a8cdb299d52829b55536a
This commit is contained in:
Atneya Nair
2023-06-30 16:32:18 -07:00
parent fbfc0e3508
commit 3c54f09a38

View File

@@ -38,13 +38,16 @@ import android.os.BatteryStatsInternal;
import android.os.Process;
import android.os.RemoteException;
import androidx.test.filters.FlakyTest;
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.internal.util.FakeLatencyTracker;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
@@ -52,8 +55,12 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@RunWith(JUnit4.class)
@FlakyTest(bugId = 275746222)
public class SoundTriggerMiddlewareLoggingLatencyTest {
@Rule
public Timeout mGlobalTimeout = Timeout.seconds(30);
private FakeLatencyTracker mLatencyTracker;
@Mock
private BatteryStatsInternal mBatteryStatsInternal;