Я автоматизирую приложение Android с помощью Espresso. Все мои тесты технически выполняются и выполняются так, как я ожидаю; Тем не менее, некоторые тесты завершаются неудачно, когда завершаются. В конце выполнения теста выдается следующее исключение:
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1514656)
E/OrchestrationListener: Unable to send TestRunFinished Status to Orchestrator
android.os.TransactionTooLargeException: data parcel size 1514656 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:1127)
at androidx.test.runner.internal.deps.aidl.BaseProxy.transactAndReadExceptionReturnVoid(BaseProxy.java:65)
at androidx.test.orchestrator.callback.OrchestratorCallback$Stub$Proxy.sendTestNotification(OrchestratorCallback.java:95)
at androidx.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.sendTestNotification(OrchestratedInstrumentationListener.java:167)
at androidx.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.testRunFinished(OrchestratedInstrumentationListener.java:104)
at org.junit.runner.notification.SynchronizedRunListener.testRunFinished(SynchronizedRunListener.java:42)
at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:103)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:100)
at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2145)
Это исключение происходит из метода testRunFinished
класса OrchestratedInstrumentationListen
:
@Override
public void testRunFinished(Result result) {
try {
sendTestNotification(
TestEvent.TEST_RUN_FINISHED, BundleJUnitUtils.getBundleFromResult(result));
} catch (RemoteException e) {
Log.e(TAG, "Unable to send TestRunFinished Status to Orchestrator", e);
}
}
При исследовании этой ошибки Я нашел много тем, ссылающихся на обработку изображений. Я не использую никаких изображений, и единственная передаваемая информация состоит из строковых данных. Единственные образы, о которых я могу думать, - это ресурсы локальных ресурсов, которые я использую вместо ссылок на версии AWS S3. Но я использую эти ресурсы изображений в других моих 50 тестах без проблем, поэтому я сомневаюсь, что это является причиной.
Я думаю, что в этом случае статус результатов теста, передаваемых в Androidx Orchestrator, равен parcel
, и, учитывая, что он составляет около 1,5 МБ, я понимаю, почему возникает исключение. Но я не уверен, как уменьшить размер результатов теста. Другие тесты с большим количеством шагов не сталкиваются с этой проблемой, поэтому я в растерянности. Я уже видел несколько советов по удалению Orchestrator, но он мне нужен для запуска тестов, поскольку они полагаются на то, что приложение находится в одном и том же состоянии в начале и в конце.
Почему это происходит и что было бы лучшим решением?