New issue
Advanced search Search tips

Issue 789313 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

tast: ui.ARCSanity sometimes fails due to chrome.autotestPrivate being undefined

Project Member Reported by derat@chromium.org, Nov 28 2017

Issue description

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.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/28fea08c4e200b17ca1de6b5f583ca811d0f60e6

commit 28fea08c4e200b17ca1de6b5f583ca811d0f60e6
Author: Daniel Erat <derat@chromium.org>
Date: Wed Nov 29 04:17:08 2017

tast-tests: Try to avoid chrome.autotestPrivate race.

Speculative fix for an apparent race where the test
extension is sometimes used before its APIs are initialized,
resulting in an undefined reference to
chrome.autotestPrivate.

BUG= chromium:789313 
TEST=chrome.TestAPIConn succeeds in local runs

Change-Id: I9d9fd8f847754f9e909c4b6d2af3a231aa6fa8ae
Reviewed-on: https://chromium-review.googlesource.com/794878
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>

[modify] https://crrev.com/28fea08c4e200b17ca1de6b5f583ca811d0f60e6/src/chromiumos/tast/local/chrome/chrome.go

Comment 2 by derat@chromium.org, Dec 31 2017

Status: Fixed (was: Started)
I haven't seen this since landing the speculative workaround.

Comment 3 by derat@chromium.org, Jan 23 2018

Components: Tests>Tast

Sign in to add a comment