eduyubero / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

Feature Request: Allow setting the startActivityTimeOut #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Hook up a debugger to a test when using GoogleInstrumentation

2. Use debugger in Activity.OnCreate  stack for more that 45 seconds 

3. Test fails with timeout and gives this exception:

java.lang.RuntimeException: Could not launch intent Intent { 
act=android.intent.action.MAIN flg=0x14000000 
cmp=com.americanexpress.android.acctsvcs.us/.billing.BillingSummaryActivity } 
within 45 seconds. Perhaps the main thread has not gone idle within a 
reasonable amount of time? There could be an animation or something constantly 
repainting the screen. Or the activity is doing network calls on creation? See 
the threaddump logs. For your reference the last time the event queue was idle 
before your activity launch request was 1401296276148 and and now the last time 
the queue went idle was: 1401296276148. If these numbers are the same your 
activity might be hogging the event queue.
at 
com.google.android.apps.common.testing.testrunner.GoogleInstrumentation.startAct
ivitySync(GoogleInstrumentation.java:277)
at 
android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTes
tCase.java:119)
at 
android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java
:97)
at 
android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentatio
nTestCase2.java:104)

What is the expected output? What do you see instead?

It would be nice to have a public setStartActivityTimeoutSeconds method on 
GoogleInstrumentation, so that it can be changed if needed.

What version of the product are you using? On what operating system?
double-espesso from Jake Wharton 

Original issue reported on code.google.com by YogurtE...@gmail.com on 28 May 2014 at 5:08

GoogleCodeExporter commented 9 years ago
It would be undesirable to add a public API just for this purpose (especially 
because people would take advantage of it to hide slow app startup time). 
Sorry, I don't use a debugger, so this may be a silly question - is it possible 
to update the value while in the debug session?

Original comment by vale...@google.com on 9 Jun 2014 at 10:09

GoogleCodeExporter commented 9 years ago
You don't use a debugger!?! :) 

Good idea! Updating the value seems to work. See screenshot from IntelliJ. 

Original comment by YogurtE...@gmail.com on 11 Jun 2014 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
Glad the suggestion worked. Resolving as "won't fix".

Original comment by vale...@google.com on 19 Nov 2014 at 9:38