ui.VirtualKeyboardOmnibox failed on elm-paladin with "Failed to click the omnibox: cdp.Runtime: Evaluate: context deadline exceeded" |
||||
Issue descriptionhttps://crrev.com/c/1235366 removed the "informational" attribute from the ui.VirtualKeyboardOmnibox Tast test so it would run on the Chrome OS CQ, but it failed soon afterward on elm-paladin: http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?builderName=elm-paladin&buildNumber=7227 From login_VMSanity.INFO in the results at http://stainless/browse/chromeos-autotest-results/241563536-chromeos-test/ : ... 2018/09/24 20:00:35 Running ui.VirtualKeyboardOmnibox 2018/09/24 20:00:35 Restarting ui job 2018/09/24 20:00:36 Waiting for org.chromium.SessionManager D-Bus service 2018/09/24 20:00:36 Asking session_manager to enable Chrome testing 2018/09/24 20:00:36 Waiting for Chrome to write its debugging port to /home/chronos/DevToolsActivePort 2018/09/24 20:00:38 Checking cryptohomed service 2018/09/24 20:00:38 Removing cryptohome for testuser@gmail.com 2018/09/24 20:00:38 Finding OOBE DevTools target 2018/09/24 20:00:38 Connecting to Chrome at ws://127.0.0.1:41491/devtools/page/6AD0C71ED180CB9B65529CEF4DA89113 2018/09/24 20:00:38 Waiting for OOBE 2018/09/24 20:00:42 Logging in as user "testuser@gmail.com" 2018/09/24 20:00:42 Waiting for cryptohome /home/user/3fcae253ea4c1ee3272b95ec581fa8c9af6d64cb 2018/09/24 20:00:43 Waiting for OOBE to be dismissed 2018/09/24 20:00:45 Waiting for test API extension at chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/_generated_background_page.html 2018/09/24 20:00:46 Connecting to Chrome at ws://127.0.0.1:41491/devtools/page/193E0D6C558466D7AB25C072040693D8 2018/09/24 20:00:47 Test API extension is ready 2018/09/24 20:02:35 Error: [virtual_keyboard_omnibox.go:59] Failed to click the omnibox: cdp.Runtime: Evaluate: context deadline exceeded 2018/09/24 20:02:36 Finished ui.VirtualKeyboardOmnibox 2018/09/24 20:02:36 -------------------------------------------------------------------------------- 2018/09/24 20:02:36 Ran 7 test(s) in 3m6.728s 2018/09/24 20:02:36 1 failed: 2018/09/24 20:02:36 ui.VirtualKeyboardOmnibox Sorry, Darren; I think we should probably temporarily revert https://crrev.com/c/1235366 to figure out the cause of the flakiness. :-(
,
Sep 25
Thanks derat@ for the revert. Does `cdp.Runtime: Evaluate: context deadline exceeded` just mean that the test timed out?
,
Sep 25
Failing code is:
// Click on the omnibox.
if err := tconn.EvalPromise(ctx, `
new Promise((resolve, reject) => {
chrome.automation.getDesktop(root => {
root.addEventListener('loadComplete', () => {
const omnibox = root.find({ attributes: { role: 'textField', inputType: 'url' }});
if (omnibox) {
omnibox.doDefault();
resolve();
} else {
reject('Could not find the omnibox in accessibility tree');
}
});
});
})
`, nil); err != nil {
s.Fatal("Failed to click the omnibox: ", err)
}
One possibility is that loadComplete event fired before event listener is added?
,
Sep 25
Hmm, that could be a possibility. The API documentation just says:
Returns a tree with a placeholder root node; listen for the "loadComplete" event to get a notification that the tree has fully loaded (the previous root node reference will stop working at or before this point).
I'll have a look tomorrow.
,
Sep 26
I had a chat with the folks who built the API and yeah listening for 'loadComplete' multiple times could be problematic. I suspect what's happening is:
1. We call getDesktop in vkb.IsShown. The desktop root loads.
2. We call getDesktop again to click the omnibox. The desktop root is already loaded, so the event handler doesn't trigger.
Aside: But how did the test pass so many times :|
As a workaround, I could just use WaitForExpr and query for the presence of the omnibox repeatedly. I'll send over a patch for this.
A full proper solution might be something like:
getDesktop(root => {
if omnibox is present
click it
else
chrome.automation.addTreeChangeObserver("allTreeChanges", function(change) {
if omnibox was added
click it
});
});
But seems a bit overkill.
,
Sep 26
Dan: Why did no other test besides login_VMSanity fail? Also, there doesn't seem to be anything board-specific about this failure?
,
Sep 26
,
Sep 26
#6: I think the test is just failing inconsistently. It looks like the same failure has occurred several times on -release builders outside of login_VMSanity: http://stainless/search?view=list&first_date=2018-09-20&last_date=2018-09-26&test=%5Etast%5C.ui%5C.VirtualKeyboardOmnibox%24&status=FAIL&exclude_cts=false&exclude_not_run=false&exclude_non_release=true&exclude_au=true&exclude_acts=true&exclude_retried=true&exclude_non_production=false I agree that it's probably not board-specific.
,
Oct 2
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/d3e93dbe7d307dedb16f34f93d928621d21a400b commit d3e93dbe7d307dedb16f34f93d928621d21a400b Author: Darren Shen <shend@chromium.org> Date: Tue Oct 02 16:17:27 2018 Make virtual keyboard tast tests less flaky. Recently we tried to remove the "informational" attribute from ui.VirtualKeyboardOmnibox, but it caused some flaky failures. The source of the flakiness might be from our use of the automation API: the 'loadComplete' event only fires once, but we listen for it multiple times, so the other times may not fire. To fix this, we just repeatedly poll whenever we are waiting for an element to appear, using |setTimeout|. We also considered a more "proper" solution of listening only re-querying on changes to the tree, but A) this requires adding a JavaScript helper function and B) there could be a lot of tree changes which means the test could run quite slowly. BUG= chromium:888884 ,chromium:879073 TEST=tested on eve Change-Id: I0df98ad7ebd9d31d0089392e256951c77bc6cf39 Reviewed-on: https://chromium-review.googlesource.com/1249403 Commit-Ready: Darren Shen <shend@chromium.org> Tested-by: Darren Shen <shend@chromium.org> Reviewed-by: Shuhei Takahashi <nya@chromium.org> [modify] https://crrev.com/d3e93dbe7d307dedb16f34f93d928621d21a400b/src/chromiumos/tast/local/bundles/cros/ui/vkb/vkb.go [modify] https://crrev.com/d3e93dbe7d307dedb16f34f93d928621d21a400b/src/chromiumos/tast/local/bundles/cros/ui/virtual_keyboard_omnibox.go [modify] https://crrev.com/d3e93dbe7d307dedb16f34f93d928621d21a400b/src/chromiumos/tast/local/bundles/cros/ui/virtual_keyboard_typing.go
,
Oct 8
|
||||
►
Sign in to add a comment |
||||
Comment 1 by bugdroid1@chromium.org
, Sep 25