Skip to content

Commit

Permalink
Deflake SandboxedHttpCacheBrowserTests
Browse files Browse the repository at this point in the history
We expected not to have a response message for CreateSimpleCache when with
invalid path settings, because the network service is killed.

The assumption is invalid. Because the mojo message ordering is not
guaranteed, it is possible that we see a response message in the browser
process. Remove the NOTREACHED statements.

Bug: 1310058
Change-Id: Ifc36b9e5da6e8e26d8a8f8f1800078e2dc450c04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552070
Auto-Submit: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985969}
  • Loading branch information
yutakahirano authored and Chromium LUCI CQ committed Mar 28, 2022
1 parent 7c21487 commit 0187456
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions content/browser/net/sandboxed_http_cache_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,13 @@ IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest,
network_service_test()->CreateSimpleCache(
std::move(factory_remote), path,
base::BindOnce([](mojo::PendingRemote<SimpleCache> cache) {
ADD_FAILURE() << "NOTREACHED";
EXPECT_FALSE(cache.is_valid());
}));
run_loop.Run();
}

#if BUILDFLAG(IS_ANDROID)
#define MAYBE_CreateSimpleCacheWithParentDirectory \
DISABLED_CreateSimpleCacheWithParentDirectory
#else
#define MAYBE_CreateSimpleCacheWithParentDirectory \
CreateSimpleCacheWithParentDirectory
#endif // BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest,
MAYBE_CreateSimpleCacheWithParentDirectory) {
CreateSimpleCacheWithParentDirectoryTraversal) {
base::RunLoop run_loop;

const base::FilePath root_path = GetTempDirPath();
Expand All @@ -175,7 +168,7 @@ IN_PROC_BROWSER_TEST_F(SandboxedHttpCacheBrowserTest,
network_service_test()->CreateSimpleCache(
std::move(factory_remote), path,
base::BindOnce([](mojo::PendingRemote<SimpleCache> cache) {
ADD_FAILURE() << "NOTREACHED";
EXPECT_FALSE(cache.is_valid());
}));
run_loop.Run();
}
Expand Down

0 comments on commit 0187456

Please sign in to comment.