New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 629127 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Jul 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

cheets_ClipboardTest: Unhandled JsonRPCError: android.support.test.uiautomator.UiObjectNotFoundException

Project Member Reported by dshi@chromium.org, Jul 18 2016

Issue description

The test failed with an unclear message:

https://pantheon.corp.google.com/storage/browser/chromeos-autotest-results/70017435-chromeos-test/chromeos4-row6-rack9-host12/debug/

Unhandled unicode: Unhandled JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.EditText]

I don't see any obvious reason. Could it be some kind of flake?

+sheriffs, please help me to find a right owner of this bug.
 

Comment 1 by dshi@chromium.org, Jul 18 2016

Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 600, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/common_lib/test.py", line 810, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.EditText]
Traceback (most recent call last):
  File "/usr/local/autotest/common_lib/test.py", line 804, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/common_lib/test.py", line 461, in execute
    dargs)
  File "/usr/local/autotest/common_lib/test.py", line 347, in _call_run_once_with_retry
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/common_lib/test.py", line 376, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/tests/cheets_ClipboardTest/cheets_ClipboardTest.py", line 103, in run_once
    self.copy_from_chrome_to_android(extension, d)
  File "/usr/local/autotest/tests/cheets_ClipboardTest/cheets_ClipboardTest.py", line 61, in copy_from_chrome_to_android
    android_paste = device(className='android.widget.EditText').text
  File "/usr/local/autotest/deps/uiautomator/uiautomator/__init__.py", line 887, in __getattr__
    info = self.info
  File "/usr/local/autotest/deps/uiautomator/uiautomator/__init__.py", line 898, in info
    return self.jsonrpc.objInfo(self.selector)
  File "/usr/local/autotest/deps/uiautomator/uiautomator/__init__.py", line 441, in wrapper
    return _method_obj(*args, **kwargs)
  File "/usr/local/autotest/deps/uiautomator/uiautomator/__init__.py", line 132, in __call__
    "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
JsonRPCError: JsonRPC Error code: -32002, Message: android.support.test.uiautomator.UiObjectNotFoundException: UiSelector[CLASS=android.widget.EditText]

Failed in copy_from_chrome_to_android
    android_paste = device(className='android.widget.EditText').text

Comment 2 by dshi@chromium.org, Jul 18 2016

Owner: dhadd...@chromium.org
Assign to test owner for now.
From the screenshot taken at [1], it seems like the app crashed so the test wasn't able to continue

[1] https://pantheon.corp.google.com/storage/browser/chromeos-autotest-results/70017435-chromeos-test/chromeos4-row6-rack9-host12/cheets_ClipboardTest/sysinfo/var/log/
Cc: dhadd...@chromium.org
Owner: dshi@chromium.org
Status: WontFix (was: Untriaged)
I guess it was flake because that is the only time I've seen this test fail.

Please reopen if it fails again and I will look into it more 



Status: Assigned (was: WontFix)
https://uberchromegw.corp.google.com/i/chromeos/builders/cyan-cheets-chrome-pfq/builds/439

It failed in the PFQ preventing a roll. If this test is unreliable, we should remove it from bvt-cq and move it elsewhere.
Cc: -dhadd...@chromium.org jhorwich@chromium.org dshi@chromium.org
Owner: dhadd...@chromium.org
Cc: achuith@chromium.org
Labels: -Pri-3 Pri-2
P2 for now. Seems to be a crash that's worth investigating. Will bump to P1 if it flakes again.
All of these failures are missing the logcat from /sysinfo/var/log/ 

The screenshots all show the app is crashing but I can't tell why and cannot reproduce locally with 10+ runs. 
I've re-opened an internal bug related to the missing logcat files.
I managed to get the crash to reproduce (after 20-30 tries, sorry didn't count the exact number).

On the bad run, I see the following in logcat output:

07-21 15:59:06.659   287   637 W ArcClipboardService: ClipboardHost not available                                                                               
07-21 15:59:06.667   287   636 W ArcClipboardService: ClipboardHost not available                                                                               
07-21 15:59:06.694   287  1033 W ArcClipboardService: ClipboardHost not available                                                                               
07-21 15:59:06.695  1469  1469 D AndroidRuntime: Shutting down VM
07-21 15:59:06.695   287   350 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz                               
07-21 15:59:06.697    21   356 D audio_hw_primary: out_set_parameters: kvpairs routing=2                                                                        
--------- beginning of crash
07-21 15:59:06.712  1469  1469 E AndroidRuntime: FATAL EXCEPTION: main
07-21 15:59:06.712  1469  1469 E AndroidRuntime: Process: org.chromium.arc.testapp.clipboard, PID: 1469                                                         
07-21 15:59:06.712  1469  1469 E AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick                                  
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.view.View$DeclaredOnClickListener.onClick(View.java:4458)                                    
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.view.View.performClick(View.java:5204)                                                       
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.view.View$PerformClick.run(View.java:21174)                                                  
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)                                                  
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)                                                  
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)                                                              
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5524)                                            
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)                                                       
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)                      
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)                                         
07-21 15:59:06.712  1469  1469 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException                                                         
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)                                                       
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at android.view.View$DeclaredOnClickListener.onClick(View.java:4453)                                    
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        ... 9 more
07-21 15:59:06.712  1469  1469 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ClipData$Item android.content.ClipData.getItemAt(int)' on a null object reference                 
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        at org.chromium.arc.testapp.clipboard.ClipboardActivity.pasteButton(ClipboardActivity.java:54)          
07-21 15:59:06.712  1469  1469 E AndroidRuntime:        ... 11 more
07-21 15:59:06.714   287   811 W ActivityManager:   Force finishing activity org.chromium.arc.testapp.clipboard/.ClipboardActivity                              


Thanks! So the Android app crashes when it tries to paste nothing. Copying to the clipboard from chrome failed for some reason. I'll look at it. I'll move the test back to bvt-perbuild in the meantime 
It seems like we have a potential problem with startup timing here. Normally, the mojo message from Chrome to ClipboardInstance Init to set the ClipboardHost arrives before the app is running, but in the case where it fails it appears to have not yet happened (as evidenced by grepping the logcat output for ArcClipboardService and seeing that ArcClipboardService.init doesn't get called - it normally emits a log statement)

I don't think there's anything inherently wrong with the test - by the time the application is running, the clipboard sync between Chrome and Android should be functioning (getPrimaryClip shouldn't be null either). I believe we'll have to be smart about deferring considering the system ready until this - and possibly other - services/hosts have initialized properly...

In the short-term, I recommend we disable this test since it is flaky, even if the flakiness is rare, until the underlying issue is resolved.
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 22 2016

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/autotest-cheets/+/e66c846a61f477e4e2d0348e464ee9c78a59d491

commit e66c846a61f477e4e2d0348e464ee9c78a59d491
Author: David Haddock <dhaddock@chromium.org>
Date: Thu Jul 21 23:50:02 2016

Status: Verified (was: Assigned)
I think we can close this bug now that it has been disabled on the CQ/PFQ. Real change is tracked here: 
https://buganizer.corp.google.com/u/0/issues/30291674

Sign in to add a comment