Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
HARDWARE PLATFORM:
Device Manufacturer:oppo-sm8650&CPH2583
Device Brand and Device Model:oplus
Android OS Version (Base OS version before installing GSI image):andriod 15
Android OS Build Number (please input the full string):CPH2583_15.0.0.9
STEPS TO REPRODUCE:
1.Replace Google cts-gsi test system.img (signed-gsi_arm64-img-11890875)
adb reboot fastboot
fastboot flash system system.img
fastboot reboot bootloader
fastboot -w
fastboot reboot
2.Google GSI certification, the test case: run cts-on-gsi -m CtsStorageHostTestCases -t android.appsecurity.cts.StorageHostTest#testCache
Test Command:run cts-on-gsi -m CtsStorageHostTestCases -t android.appsecurity.cts.StorageHostTest#testCache
REPRODUCE RATE:
5/5
OBSERVED RESULTS:
this test can not be passed
EXPECTED RESULTS:
this test can pass
BUG REPORT:attachment
ADDITIONAL INFORMATION:
<Test result="fail" name="testCache">
<Failure message="java.lang.AssertionError: on-device tests failed:">
<StackTrace>java.lang.AssertionError: on-device tests failed:
com.android.cts.storagestatsapp.StorageStatsTest#testCacheClearing:
junit.framework.AssertionFailedError: Expected roughly 483124412416 but was 483066744832 [UserHandle{0}]
at com.android.cts.storageapp.Utils.assertMostlyEquals(Utils.java:100)
at com.android.cts.storagestatsapp.StorageStatsTest.testCacheClearing(StorageStatsTest.java:397)
at com.android.cts.storagestatsapp.StorageStatsTest.testCacheClearing(StorageStatsTest.java:348)
at java.lang.reflect.Method.invoke(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:220)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:205)
at com.android.tradefed.testtype.junit4.BaseHostJUnit4Test.runDeviceTests(BaseHostJUnit4Test.java:749)
at com.android.tradefed.testtype.junit4.BaseHostJUnit4Test.runDeviceTests(BaseHostJUnit4Test.java:486)
at android.appsecurity.cts.StorageHostTest.runDeviceTests(StorageHostTest.java:289)
at android.appsecurity.cts.StorageHostTest.runDeviceTests(StorageHostTest.java:277)
at android.appsecurity.cts.StorageHostTest.testCache(StorageHostTest.java:218)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:61)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at android.platform.test.flag.junit.CheckFlagsRule$1.evaluate(CheckFlagsRule.java:52)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at com.android.tradefed.testtype.DeviceJUnit4ClassRunner.runChild(DeviceJUnit4ClassRunner.java:111)
at com.android.tradefed.testtype.DeviceJUnit4ClassRunner.runChild(DeviceJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at com.android.tradefed.testtype.DeviceJUnit4ClassRunner.run(DeviceJUnit4ClassRunner.java:147)
at com.android.tradefed.testtype.junit4.ExceptionThrowingRunnerWrapper.run(ExceptionThrowingRunnerWrapper.java:43)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.android.tradefed.testtype.HostTest.runJUnit4Tests(HostTest.java:763)
at com.android.tradefed.testtype.HostTest.runTestClasses(HostTest.java:643)
at com.android.tradefed.testtype.HostTest.run(HostTest.java:591)
at com.android.compatibility.common.tradefed.testtype.JarHostTest.run(JarHostTest.java:56)
at com.android.tradefed.testtype.suite.GranularRetriableTestWrapper.intraModuleRun(GranularRetriableTestWrapper.java:384)
at com.android.tradefed.testtype.suite.GranularRetriableTestWrapper.run(GranularRetriableTestWrapper.java:281)
at com.android.tradefed.testtype.suite.ModuleDefinition.run(ModuleDefinition.java:599)
at com.android.tradefed.testtype.suite.ITestSuite.runSingleModule(ITestSuite.java:1113)
at com.android.tradefed.testtype.suite.ITestSuite.run(ITestSuite.java:916)
at com.android.tradefed.invoker.InvocationExecution.runTest(InvocationExecution.java:1447)
at com.android.tradefed.invoker.InvocationExecution.runTests(InvocationExecution.java:1222)
at com.android.tradefed.invoker.TestInvocation.prepareAndRun(TestInvocation.java:632)
at com.android.tradefed.invoker.TestInvocation.performInvocation(TestInvocation.java:287)
at com.android.tradefed.invoker.TestInvocation.invoke(TestInvocation.java:1422)
at com.android.tradefed.command.CommandScheduler$InvocationThread.run(CommandScheduler.java:689)
</StackTrace>
</Failure>
</Test>
StorageStatsTest.java
private void testCacheClearing(int[] originalCacheReservePercents) throws Exception {
...
final long beforeAllocatable = sm.getAllocatableBytes(filesUuid);
....
if (stats.isQuotaSupported(filesUuid)) {
assertMostlyEquals(beforeAllocatable,
sm.getAllocatableBytes(filesUuid), 10 * MB_IN_BYTES);
assertMostlyEquals(beforeFree,
stats.getFreeBytes(filesUuid), 10 * MB_IN_BYTES);
}
}
Utils.java
public static void assertMostlyEquals(long expected, long actual, long delta) {
if (Math.abs(expected - actual) > delta) {
throw new AssertionFailedError("Expected roughly " + expected + " but was " + actual
+ " [" + android.os.Process.myUserHandle() + "]");
}
}
it seems that AssertionFailedError occurred because Math.abs(expected - actual) >10M