kezhou2 / android-test-kit

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

scrollTo() causes a full freeze of thread #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Use a scrollTo() as part of a ViewAction in a perform() method.

What is the expected output? What do you see instead?
I would expect the execution to move onto the next ViewAction, but instead it 
locks up, and the thread continually waits.

What version of the product are you using? On what operating system?
Running on Nexus 4, 4.3 JellyBean

Please provide any additional information below.

The view *is* in the layout, and is a descendant of a ScrollView. There is 
nothing special about the layout. The text is non-null. The view is View.VISIBLE

Sample line causing issues: 
onView(ViewMatchers.withId(R.id.prescription_remarks_edit)).perform(ViewActions.
scrollTo(), ViewActions.typeText(mMedication.getRemarks()));

Stack trace: (application package obscured by #'s)
com.###.###.###.test.CZInstrumentationRunner@831725150536, prio=5, in group 
'main', status: 'WAIT'
      at java.lang.Object.wait(Object.java:-1)
      at java.lang.Thread.parkFor(Thread.java:1231)
      at sun.misc.Unsafe.park(Unsafe.java:323)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:159)
      at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:396)
      at java.util.concurrent.FutureTask.get(FutureTask.java:159)
      at com.google.android.apps.common.testing.ui.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:142)
      at com.google.android.apps.common.testing.ui.espresso.ViewInteraction.doPerform(ViewInteraction.java:77)
      at com.google.android.apps.common.testing.ui.espresso.ViewInteraction.perform(ViewInteraction.java:69)
      at com.###.###.###.test.D_MedicationTest.testAdd(D_MedicationTest.java:69)
      at com.###.###.###.test.BaseModuleTest.testModule(BaseModuleTest.java:62)
      at java.lang.reflect.Method.invokeNative(Method.java:-1)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
      at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
      at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:115)
      at junit.framework.TestResult.runProtected(TestResult.java:133)
      at junit.framework.TestResult.run(TestResult.java:118)
      at junit.framework.TestCase.run(TestCase.java:124)
      at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
      at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
      at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
      at com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner.onStart(GoogleInstrumentationTestRunner.java:119)
      at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1661)

Original issue reported on code.google.com by christia...@gmail.com on 25 Oct 2013 at 11:03

GoogleCodeExporter commented 9 years ago
It'll be very difficult to debug this without a repro that we can run locally. 
If you can't share the exact activity on which this happens, could you put 
together a repro with a similar test activity and attach it to the bug?

Original comment by vale...@google.com on 5 Nov 2013 at 5:38

GoogleCodeExporter commented 9 years ago
+ please add a full thread dump. Just the instrumentaiton thread is not 
interesting.

Original comment by thoma...@google.com on 5 Nov 2013 at 7:55

GoogleCodeExporter commented 9 years ago
No additional info provided, so resolving "won't fix".

Original comment by vale...@google.com on 17 Dec 2013 at 12:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I also faced the similar issue when i was using the Junit3 framework for 
testing my application,In which i used the Solo.ScrollToTop() for going to the 
top of the screen. I think it is avery critical issue and needed to be 
fixed.Here is state of my InstrumentationRunner once it stops running without 
any error or crash (i found it going to indefinite waiting state)
  at java.lang.Object.wait(Native Method)   
  at java.lang.Object.wait(Object.java:364) 
  at android.app.Instrumentation.startActivitySync(Instrumentation.java:408)    
  at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119)    
  at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
  at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)   
  at com.example.Project.test.Testfile12.setUp(Alarm12.java:49) 
  at junit.framework.TestCase.runBare(TestCase.java:132)    
  at junit.framework.TestResult$1.protect(TestResult.java:115)  
  at junit.framework.TestResult.runProtected(TestResult.java:133)   
  at junit.framework.TestResult.run(TestResult.java:118)    
  at junit.framework.TestCase.run(TestCase.java:124)    
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) 
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) 
  at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1738)

Original comment by vivek.vi...@gmail.com on 23 Dec 2013 at 8:18