I've noticed that the ui.ARCSanity test sometimes fails in the TastVMTest stage on betty-release. See http://uberchromegw/i/chromeos/builders/betty-release/builds/749, for example:
---
2017/11/28 06:13:16 Started test ui.ARCSanity
2017/11/28 06:13:16 [06:13:15.474] Restarting ui job
2017/11/28 06:13:17 [06:13:16.461] Waiting for org.chromium.SessionManager D-Bus service
2017/11/28 06:13:17 [06:13:16.484] Asking session_manager to enable Chrome testing
2017/11/28 06:13:17 [06:13:16.485] Waiting for Chrome to write its debugging port
2017/11/28 06:13:17 [06:13:16.968] Clearing cryptohome for testuser@gmail.com
2017/11/28 06:13:17 [06:13:17.022] Finding OOBE DevTools target
2017/11/28 06:13:17 [06:13:17.302] Connecting to Chrome at ws://127.0.0.1:35016/devtools/page/(1519E8A5FEE16F5BF8F9C23BDBEEF236)
2017/11/28 06:13:18 [06:13:17.365] Waiting for OOBE
2017/11/28 06:13:20 [06:13:19.938] Logging in as user "testuser@gmail.com"
2017/11/28 06:13:20 [06:13:20.003] Waiting for cryptohome /home/user/bfaf80291798aebfb206616fe82896e24a61dc5f
2017/11/28 06:13:25 [06:13:25.196] Waiting for OOBE to be dismissed
2017/11/28 06:13:26 [06:13:26.278] Enabling Play Store
2017/11/28 06:13:26 [06:13:26.278] Waiting for test API extension at chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/_generated_background_page.html
2017/11/28 06:13:27 [06:13:26.646] Connecting to Chrome at ws://127.0.0.1:35016/devtools/page/(439EFA5413DC8FE17563CC1480943A67)
2017/11/28 06:13:27 [06:13:26.963] Error at arc_sanity.go:23: Failed to connect to Chrome: failed enabling Play Store: got exception: TypeError: Cannot read property 'setPlayStoreEnabled' of undefined
at <anonymous>:1:24
2017/11/28 06:13:27 [06:13:26.963] Stack trace:
chromiumos/tast/local/tests/ui.ARCSanity(0xc420010640)
/build/betty/tmp/portage/chromeos-base/tast-local-tests-0.0.1-r27/work/tast-local-tests-0.0.1/src/chromiumos/tast/local/tests/ui/arc_sanity.go:23 +0x128
chromiumos/tast/common/testing.(*Test).Run.func1(0xc420010640, 0xc4200560e0, 0xc42008b260)
/build/betty/usr/lib/gopath/src/chromiumos/tast/common/testing/test.go:72 +0x66
created by chromiumos/tast/common/testing.(*Test).Run
/build/betty/usr/lib/gopath/src/chromiumos/tast/common/testing/test.go:65 +0xb3
2017/11/28 06:13:27 Completed test ui.ARCSanity in 11.5 sec with 1 error(s)
---
It looks like chrome.autotestPrivate is sometimes undefined when chrome.autotestPrivate.setPlayStoreEnabled is called. My guess would be that there's a race where we try to use the extension before it's been fully initialized (but after it's listed as a debugging target and accepting connections). The simplest fix is probably to make chrome.TestAPIConn() wait for chrome.autotestPrivate to be defined.
Comment 1 by bugdroid1@chromium.org
, Nov 29 2017