Android Instrumentation Tests卡在了“运行测试"中永远的Android Studio [英] Android Instrumentation Tests Stuck "Running Tests" Forever Android Studio

本文介绍了Android Instrumentation Tests卡在了“运行测试"中永远的Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在最新的Android Studio 2.1.2上使用Android Espresso测试,并且测试运行正常,但是独立测试应用似乎无法返回结果以反映回Android Studio,并且显示永远运行测试"

I use Android Espresso Tests with latest Android Studio 2.1.2 and Tests are running ok but it does not seems like the standalone test app returns back the results to reflect back to Android Studio and it shows Running Tests Forever

推荐答案

我意识到这是一个老问题,但我遇到了这个问题,却没有看到其他任何出现相同问题的搜索结果.

I realize this is an old question, but I just ran into this and didn't see any other search results that had the same problem.

在我的情况下,这是由处于堆栈溢出异常的被测代码引起的,该异常似乎是测试运行程序未能处理的.我只能通过查看"Android Monitor"并查看日志猫来弄清楚.

In my case, this was caused by the code under test having a stack overflow exception, which it seems that the test runner failed to handle. I was only able to figure it out by looking at the "Android Monitor" and looking in the logcat.

因此,如果您到了AS永远坐在运行测试"的地步,您可能希望在logcat中查找测试运行程序无法处理的异常.

So if you get to the point where AS just sits at "running test" forever, you might want to look in logcat for an exception that the test runner couldn't handle.

这篇关于Android Instrumentation Tests卡在了“运行测试"中永远的Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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