大量的单元测试导致冻结失败的粘结剂交易 [英] Large amount of unit tests cause freezes with Failed Binder Transaction

查看:158
本文介绍了大量的单元测试导致冻结失败的粘结剂交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我有我的Andr​​oid应用程序的书面约400单元测试。如果我用包运行测试包,一切工作正常,我所有的测试通过。不过,如果我尝试运行一次全部,最终(约360测试中),机器人开始吐出!失败的粘结剂交易错误!!! 。经过有关这些错误10-20,该进程为应用程序我测试被打死,单元测试甚至从来没有完成。

I have about 400 unit tests that I have written for my Android application. If I run the tests package by package, everything works fine and all my tests pass. However, if I try to run them all at once, eventually (about 360 tests in), Android starts spitting out !!! Failed Binder Transaction Errors !!!. After about 10-20 of these errors, the process for the application I am testing gets killed and the unit tests never even complete.

我要指出,在这段时间内的Eclipse报告收集在控制台测试信息。我认为这是奇怪的,因为它表明它正在运行的测试,即使JUnit的用户界面不会反映。当一切工作正常,在收集考试信息阶段我看到测试运行,JUnit的UI再出现,然后所有的测试再次运行(我知道这由阅读logcat中)。这是(我认为)一个单独的问题,但我觉得我会提到它,如果任何人知道那是什么。

I should note that during this time Eclipse reports Collecting test information in the Console. I think that is odd because it shows that it is running tests even though the JUnit UI doesn't reflect that. When everything works properly, during the Collecting test information phase I see the tests run, the JUnit UI then comes up, and then all the tests are run again (I know this by reading logcat). That is (I think) a separate issue, but I felt I would mention it if anybody knew what that was about.

修改为6月6日的2011

按照下面克里的回答,我已经验证这只是试图通过Eclipse中运行这个时候发生。如果我使用ANT运行我的测试套件,所有的测试最终执行。

As per Christopher's answer below, I have verified that this only happens when attempting to run this through Eclipse. If i run my test suite using ANT, all the tests finally execute.

当我尝试到现在运行我的测试套件,Eclipse的本质挂在收集测试信息。我还没有让它运行了很长一段时间,但我会给予一个,只要我能看它是否曾经完成试。

When I attempt to run my test suite now, Eclipse essentially hangs on "collecting test information". I haven't let it run for an extended period of time, but I will give that a try as soon as I can to see if it ever completes.

推荐答案

我调查了这一次,据我所知,这纯粹是一个问题,Android的Eclipse插件。这似乎是固定的,但仍然会发生,有时一个问题(可能是依赖于机器的)。

I investigated this again and, as far as I can tell, this is purely an issue with the Android Eclipse plugin. An issue that seems to be fixed, but still can occur sometimes (possibly it's machine-dependent).

至于你提到的Eclipse插件似乎运行所有测试两次。它实际上做的第一时间收集测试套件和测试的名称,以便它可以显示在漂亮的层次JUnit的用户界面的所有测试的名称。

As you mention, the Eclipse plugin appears to run all the tests twice. What it's actually doing the first time is gathering the test suite and test names, so that it can show all the test names in that nice hierarchical JUnit UI.

然而,跑像这样的测试似乎引起问题。由于Android的SDK工具V8的一部分,<一个href="http://android.git.kernel.org/?p=platform/sdk.git;a=commitdiff;h=c7e4658b149c04820bd8ea8da7bc2515df6a94a3"相对=nofollow>一个解决办法增加了哪些地方检查每个测试之间的15ms的延迟。这样做是为了prevent粘合剂事务失败......对于大型测试套件。

However, "running" the tests like this seems to cause a problem. As part of Android SDK Tools v8, a "workaround" was added which places a 15ms delay between checking each test. This is done to prevent "Binder transaction failures ... for large test suites".

事实上,我又回到了我的项目是具有失败粘结剂交易的错误,我无法重现它的命令行上。我们也尝试在Eclipse中,它不能被复制的话(尽管我敢肯定,我们已经SDK工具R8 +当我们最初看到这一点)。

Indeed, I went back to my project that was having the "FAILED BINDER TRANSACTION" errors, and I could not reproduce it on the command line. We also tried in Eclipse and it couldn't be reproduced any more (even although I'm sure we had SDK Tools r8+ when we originally saw this).

不过,我仍然可以大致重现它在Eclipse中。尝试再次运行测试,从Eclipse中使用了最新的Andr​​oid工具,或尝试我创造了这个最小的GitHub库,看看是否可以重现它:
https://github.com/orrc/android-large-test-failures#readme

However, I can still generally reproduce it in Eclipse. Try running your tests again from Eclipse with the latest Android tools, or try out this minimal GitHub repository I created and see if you can reproduce it:
https://github.com/orrc/android-large-test-failures#readme

这篇关于大量的单元测试导致冻结失败的粘结剂交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆