Commit 6558b120 authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Chromium LUCI CQ

Attempt to de-flake browser_tests

Mojofying service worker storage operations introduced some test
flakiness. A summary of the cause is:
- These tests uses browser contexts and browser contexts initialize
  storage partition.
- Storage partition initialization schedules some tasks which call
  service worker storage operations but don't wait for results.
- Mojo generated bindings for storage operations have DCHECKs to
  make sure callbacks of these calls are executed before destroying
  mojo connections.
- These DCHECKs fail because tasks don't wait for results.

This CL runs pending tasks in ProxyRunTestOnMainThreadLoop() as
suggested in [1].

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2561963/comment/e878eb61_e0080fca/

Bug: 1153911, 1133143
Change-Id: Ie930f5ce0aa809e45877127988b99ec603cdcfd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567010Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833111}
parent 742ee63d
......@@ -790,6 +790,11 @@ void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
}
PostRunTestOnMainThread();
// Sometimes tests initialize a storage partition and the initialization
// schedules some tasks which need to be executed before finishing tests.
// Run these tasks.
content::RunAllPendingInMessageLoop();
}
void BrowserTestBase::SetAllowNetworkAccessToHostResolutions() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment