100 Commits
Author SHA1 Message Date
Netzenbot 4f5982f522 Fix intermittent timeout in GlobalPrivacyControlBrowserTest.IncludesSecGPCHeader (#36402)
* Fix intermittent timeout in GlobalPrivacyControlBrowserTest.IncludesSecGPCHeader

The test was timing out on Windows x86 nightly (issue #55215). The timeout
occurred during the browser test startup flush, where all pending browser
startup tasks are drained via RunUntilIdle. On resource-constrained x86
machines, certificate verification overhead during HTTPS connections
contributed to the timeout.

Add ContentMockCertVerifier to bypass real SSL certificate verification
in the test. This eliminates certificate verification overhead during
both browser startup (for any HTTPS requests made by startup tasks) and
the test's HTTPS navigation. The test verifies Sec-GPC header presence,
not certificate handling, so mocking cert verification is appropriate.

Also fix GlobalPrivacyControlPolicyTest::SetUpInProcessBrowserTestFixture
to call the correct parent class method, ensuring the mock cert verifier
is properly initialized for policy tests.

Resolves brave/brave-browser#55215
2026-06-05 22:01:43 +09:00
Netzenbot 9bbc220314 Disable ServiceWorkerStopTrackingBrowserTest MSAN failure (#36723)
The test captures a const reference to a ServiceWorkerRunningInfo
map entry, stops the service worker (which removes the entry), then
reads from the dangling reference in OnStoppedSync(). MSan catches
this as use-of-uninitialized-value. Same root cause as the sibling
test already filtered (issue #54959).

Upstream Chromium test, stable upstream (0.3% flake rate, LUCI
Analysis 30-day lookback). No Brave modifications in the test area.

Resolves https://github.com/brave/brave-browser/issues/55396
2026-05-26 10:56:47 -04:00
Netzenbot 9b1f8b46a0 Disable CookieStoreSameSiteTest on Linux (#36694)
Race between document.cookie setter (CookieJar mojo pipe, async with
AsyncSetCookie) and cookieStore.get() (CookieStore API, separate mojo
pipe). These use independent RestrictedCookieManager pipes with no
ordering guarantee. Brave's ephemeral storage checks add processing
overhead that widens the race window enough to cause intermittent
failures. Stable upstream (0.2% flake rate per LUCI Analysis).

Resolves https://github.com/brave/brave-browser/issues/55325
2026-05-25 12:59:30 -04:00
Netzenbot 14051d7417 Disable flaky Chromium test AutofillProgressDialogViewsBrowserTest.CloseBrowserWhileDialogShowing/3 on Windows (#36390)
Disable Chromium test AutofillProgressDialogViewsBrowserTest.CloseBrowserWhileDialogShowing/3 on Windows

This is an upstream Chromium test that is stable upstream (0.1% flake
rate over 30 days per LUCI Analysis). The intermittent timeout occurs
during browser close with the autofill progress dialog showing. Brave's
additional feature shutdown overhead triggers the RunLoop timeout under
high CI parallelism (32 jobs). No Brave chromium_src overrides exist for
the dialog views, controller, or ChromePaymentsAutofillClient.

Resolves https://github.com/brave/brave-browser/issues/55112
2026-05-25 11:17:10 -04:00
Netzenbot 3166cecfc0 Disable flaky CookieUseCounterBrowserTest.HttpOnlyCookieShadowedByNonHttpOnlyPartitioned_BothAvailable (#36400)
The test uses multiple navigations to set cookies then checks UseCounter
histogram counts. Late-arriving cookie access events from earlier
navigations cause double-counted UseCounter features (expected 1, got 2).
Brave's Ephemeral Storage cookie handling modifications make the timing
more sensitive than upstream.

Stable upstream (0.2% flake rate / 30d per LUCI Analysis). Upstream
deflake CL chromium-review.googlesource.com/c/chromium/src/+/7694592
redesigns the test to set cookies programmatically and use iframes, but
landed after the Chromium 148 branch cut. Will be picked up in a future
Chromium roll.

Resolves https://github.com/brave/brave-browser/issues/55224
2026-05-14 15:46:50 -04:00
Netzenbot 6ef98b50a9 Fix race in AdBlockServiceTest initial engine wait (#36305)
Fix race in AdBlockServiceTest.PreRunTestOnMainThread

The RunUntil condition checked a histogram recorded on a background
thread. Due to the incoming-queue/work-queue split in Chromium's
SequenceManager, RunUntil could return after seeing the histogram
sample but before OnEngineLoaded dispatched OnFilterListLoaded on the
UI thread. The observer created in InstallComponent then caught this
stale notification, leaving the histogram count at 1 instead of 2.

Switch to IsFilterListLoadedForTesting(true), a UI-thread flag set
in OnEngineLoaded, which guarantees the reply callback has been fully
processed before RunUntil returns.

Resolves brave/brave-browser#55007
2026-05-13 12:28:01 -04:00
Netzenbot 51176a84e1 Fix flaky EmailAliasesBrowserTest.ContextMenuAuthorizedManage (#36306)
The test intermittently fails with "deepQuery is not defined" because
InjectHelpers injects the helper function into the bubble's WebContents
before the WebUI navigation has committed. WaitForLoadStop returns
immediately when no navigation is pending (e.g., the WebContents is
still at about:blank), so deepQuery is injected into the pre-navigation
context, then lost when chrome://email-aliases.panel/ loads.

Wait for the WebContents to commit a non-empty, non-about:blank URL
before calling WaitForLoadStop and injecting JavaScript.

Fix brave/brave-browser#55000
2026-05-12 14:06:07 -04:00
Netzenbot df69d8be23 Disable flaky Chromium test SocketApiTest.SocketTCPExtension (#36170)
* Disable flaky Chromium test SocketApiTest.SocketTCPExtension

Re-add filter entry for SocketApiTest.SocketTCPExtension that was
lost during a Chromium version update. This is an upstream Chromium
test (chrome/browser/extensions/api/socket/socket_apitest.cc) with a
known flakiness rate of 5.8% in LUCI Analysis (30-day lookback,
83,121 verdicts). Already disabled on Windows by Chromium
(crbug.com/1319604). Brave has no chromium_src overrides in the
socket API path.

The test intermittently fails in testPendingCallback because TCP
read() returns partial data (HTTP headers only) when the response
arrives in multiple segments — the test incorrectly assumes a single
read returns the complete response.

Resolves https://github.com/brave/brave-browser/issues/54922

* Add inline comment for SocketApiTest filter entry
2026-05-07 11:59:00 -04:00
Netzenbot ff51fc04a7 Fix crash in deferred kNodeCreated notification during tab pin (#36122)
The deferred kNodeCreated notification (posted via PostTask in
AddTreeTabNode) can fire while the tab strip model and views are out
of sync. On macOS, Cocoa event loop pumping during pin/move operations
can deliver the posted task before views have been updated, causing
tab_at(index) to access an index beyond the view count.

Add a bounds check against the tab strip's view count so the handler
gracefully skips when views haven't caught up with the model.

Resolves https://github.com/brave/brave-browser/issues/54541
2026-05-07 11:58:18 -04:00
Netzenbot 9971db0e0e Fix cookie IPC race in browsing data test utility (#36125)
The upstream Chromium test BrowserContextDestructionVsCookieRemoval
flakes because document.cookie (set via JavaScript in the renderer)
uses a different Mojo pipe than GetAllCookies (queried from the browser
via CookieManager), with no ordering guarantee between the two.

Brave amplifies this from the upstream ~0.6 % rate because Ephemeral
Storage forces every cookie operation through IPC (disabling Chromium's
cookie cache optimization in CookieJar::IPCNeeded).

Add a chromium_src override for browsing_data_test_util.cc that calls
HasDataForType after SetDataForType.  For cookies this forces a
round-trip through RestrictedCookieManager → CookieStore, serialising
with the prior SetCanonicalCookieAsync on the same CookieMonster task
runner and guaranteeing the cookie is committed before any subsequent
GetAllCookies query.

The BrowserContextDestructionVsCookieRemoval test has a separate issue:
BlockUntilCompletion() never returns after the incognito profile is
destroyed during data removal.  CookieIncognitoDeletion also hangs in
incognito mode.  Both remain disabled in the filter file.

Resolves brave/brave-browser#54537
2026-05-07 11:57:37 -04:00
Netzenbot 2cd44fb436 Fix flaky EmailAliasesBrowserTest.ContextMenuAuthorized (#36161)
The test intermittently failed with "deepQuery is not defined" because
InjectHelpers() could execute on the bubble's WebContents before its
WebUI page (chrome://email-aliases.panel/) had finished loading. When
the WebUI document committed after injection, the JavaScript context
was replaced and deepQuery was lost.

Add WaitForLoadStop() in InjectHelpers() to ensure the target
WebContents has finished loading before injecting helper functions.
This matches the pattern used by brave_wallet_tab_helper_browsertest.

Resolves brave/brave-browser#54889
2026-05-07 11:55:53 -04:00
Netzenbot 45b6631ed2 Disable flaky PasswordStatusCheckServiceBaseTest.PrefInitialized on Windows (#36178)
Upstream Chromium test with 1.0% flake rate (182K verdicts over 30 days
per LUCI Analysis). Root cause is FindNewCheckTime() scheduling past
Now()+interval due to LocalMidnight() timezone boundary. Already
filtered on Linux. No Brave chromium_src overrides affect scheduling.

Resolves https://github.com/brave/brave-browser/issues/54960
2026-05-07 11:53:35 -04:00
Netzenbot e8bd8166db Disable flaky ServiceWorkerIdTrackingBrowserTest on MSan (#36179)
Disable Chromium test ServiceWorkerIdTrackingBrowserTest.WorkerNotStalledInStopping_RemovedByRenderStopNotificationFirst on MSan

The upstream test captures a const reference to a ServiceWorkerRunningInfo
map entry, stops the service worker (removing the entry), then reads from
the now-dangling reference. MSan correctly detects this use-after-free.
The bug does not manifest in non-sanitizer builds because the freed memory
typically still contains valid data.

Stable upstream: 0.2% flake rate over 30 days (LUCI Analysis).
No Brave modifications in chrome/browser/extensions/ for this file.

Resolves https://github.com/brave/brave-browser/issues/54959
2026-05-07 11:52:29 -04:00
Netzenbot 17bb98ec45 Disable flaky Chromium test PageStabilityMetricsTest.Paint on Linux (#36133)
This is an upstream Chromium test. Brave's cosmetic filters inject
MutationObserver and setInterval(500ms) polling on all pages, preventing
Blink's IdlenessDetector from reaching its 500ms quiet window needed for
NetworkBecameIdle. The Paint test triggers this by resolving the network
request after paint stability is reached, then waiting for the
network/main-thread idle histogram that never fires.

Same root cause as already-disabled PageStabilityMetricsTest.
NetworkAndMainThreadIdle (Linux, #54205) and PageStabilityMetricsTest.
Paint (Windows, #54186). Upstream flake rate is 2.5% over 30 days per
LUCI Analysis.

Resolves https://github.com/brave/brave-browser/issues/54503
2026-05-04 11:45:11 -04:00
Netzenbot 2d7c0ebd10 Disable SearchEngineChoiceDialogBrowserTest extension DSE test on Linux (#36120)
The Chromium test DialogDoesNotShowWithExtensionEnabledThatOverridesDSE
fails on Linux because ApplyDefaultSearchChangeForTesting(FROM_EXTENSION)
leaves default_search_provider_ null (extension DSEs are unsupported on
Linux) while default_search_provider_source_ stays FROM_EXTENSION.
Brave's DefaultSearchManager override causes MaybeShowDialog() to record
the Search.ChoiceScreenNavigationConditions histogram twice with
differing conditions (kControlledByPolicy and kExtensionControlled),
failing the ExpectUniqueSample assertion.

Already disabled on Windows in upstream source. Upstream TODO
crbug.com/429600559 acknowledges the broken extension DSE test setup.
Stable upstream (0.3% flake rate over 30 days per LUCI Analysis).

Resolves https://github.com/brave/brave-browser/issues/54542
2026-05-04 11:39:52 -04:00
NetzenbotandClaude Sonnet 4.6 f3465bb4fd Update best practices from upstream Chromium docs (#36084)
* Update best practices from upstream Chromium docs

Add three new rules sourced from upstream Chromium documentation:

- CS-070: Pointer/reference symbol positioning (T* not T *)
- CS-071: No Yoda conditions (foo == 0, not 0 == foo)
- TI-041: Feature flag combination testing with bitmask parameterization

Source URLs checked: Chromium C++ style guide, Chromium C++ testing
best practices, smart pointer guidelines, container guidelines,
componentization cookbook.

* Remove best practices covered by linting and formatting tools

CS-070 (pointer/reference positioning) is enforced by clang-format.
CS-071 (no Yoda conditions) is caught by clang-tidy.
Neither belongs in a human-facing best practices doc.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-01 18:43:20 -04:00
Netzenbot 675d9ececf Fix intermittent VariationsBrowserTest.BraveSeedApplied failure (#35722)
The SeedFileTrial randomly assigns ~50% of non-stable clients to
read the variations seed from a file instead of prefs. Since the
PRE_ test writes the seed to prefs via WriteSeedData(), the main
test fails when the trial puts the browser in the seed-file group
because the seed file is empty (kUnloadableRegularSeedNotUsed).

Force the SeedFileTrial to the Default group so seed loading
always reads from prefs where the test seed is stored.

Resolves https://github.com/brave/brave-browser/issues/54577
2026-05-01 18:40:31 -04:00
Netzenbot a2a825efca Disable flaky CookieUseCounterBrowserTest.PartitionedCookiePresentV3_CountOnce (#36089)
Chromium test with 1.1% upstream flake rate (83k+ verdicts, LUCI
Analysis 30-day lookback). The PartitionedCookiePresentV3 UKM is
recorded per cookie access event without per-page deduplication, so
the test's delta occasionally gets 2 instead of 1 when a prior
navigation's UKM recording arrives after the baseline snapshot.

Fixed upstream (crrev.com/c/7746704) by adding a per-page tracking
flag to PageImpl, but that fix has not landed in Chromium 148.

No Brave chromium_src overrides for content/browser/renderer_host/
cookie_utils.cc. Chromium also disabled this test temporarily
upstream before the fix landed.

Resolves https://github.com/brave/brave-browser/issues/55020
2026-05-01 15:40:28 -04:00
NetzenbotandClaude Sonnet 4.6 761794b174 Fix intermittent FilTxManagerUnitTest crash from singleton state leak (#35836)
* Fix FilTxManagerUnitTest singleton state leak vulnerability

BlockchainRegistry is a process-level NoDestructor singleton. When
other tests in the binary (e.g. AddHDAccountForKeyring_RestrictedAddress)
restrict addresses derived from kMnemonicDivideCruise and crash before
cleanup, the restricted list persists. This causes CreateDefaultAccounts
to fail when the ETH default account address is restricted, triggering
Reset(true) which clears all keyrings, making EnsureFilTestAccount
return null and FilTestAcc dereference it.

Clear restricted addresses at the start of SetUp to protect against
singleton state leaks from prior tests. Add ASSERT_TRUE on wallet
account creation so SetUp aborts early with a clear error. Add CHECK
in FilTestAcc to prevent null dereference crashes.

* Address review: use absl::Cleanup in restricted address tests

Replace manual UpdateRestrictedAddressesList({}) cleanup calls with
absl::Cleanup to ensure restricted addresses are cleared even when
tests fail early. Remove defensive ClearRestrictedAddresses from
FilTxManagerUnitTest::SetUp since the root cause is now fixed at
the source.

* Address review: add ScopedRestrictedAddressesForTesting

Replace absl::Cleanup pattern with a RAII scoped class on
BlockchainRegistry that saves/restores restricted addresses,
preventing singleton state leaks between test fixtures.

* Address review: move comment to before AddNewHDAccount(1) call

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-01 14:40:43 -04:00
Netzenbot ea361c39a5 review-prs: teach subagents about non-master base branches (#35952)
Teach review-prs subagents about non-master base branches

PRs targeting feature branches (not master, not version uplift branches)
were causing false positives: subagents couldn't find symbols/files in the
source tree and incorrectly flagged them as missing, not realising the code
was introduced by the base branch rather than master.

- Add is_feature_branch() using _fp_mod.is_version_branch() for detection
- Pass baseRefName through pr_entry() -> process_pr() -> build_subagent_prompt()
- Inject a NOTE at the top of each subagent prompt when base is a feature
  branch, naming the branch and providing the exact gh api lookup command
- Add base branch awareness rule to _REVIEW_RULES
- Add {base_branch_validation_note} placeholder to _VALIDATION_INSTRUCTIONS,
  populated with the concrete repo/branch lookup command when applicable
2026-04-30 11:55:05 -04:00
Netzenbot ab9a290516 Fix intermittent SpeedReaderBrowserTest.ShowOriginalPage failure (#35718)
WaitDistilled() was called without checking its return value.
If distillation times out or fails, the state doesn't reach
Distilled, but the test proceeds to look for a DOM element
that only exists in distilled HTML, resulting in a misleading
timeout error.

All other calls to WaitDistilled() in this file use
ASSERT_TRUE(WaitDistilled()), which catches the failure early
with a clear error message.

Resolves brave/brave-browser#54582
2026-04-24 14:35:12 -04:00
Netzenbot 7943957b04 Disable Chromium test GetDisplayMediaHiDpiBrowserTest.Capture (#35890)
Brave's canvas farbling (PerturbPixels) modifies getImageData() results,
breaking this test's canvas-based video playback detection. The test uses
canvas fingerprinting to detect video playback, which is incompatible
with Brave's privacy protections. The test only compiles on Linux
non-sanitizer builds per #if BUILDFLAG(IS_LINUX).

These filter entries were previously added (PRs #34531, #35267) but were
inadvertently removed by the automated filter pruning script in #35339.

Upstream stable: 640x480 0.6%, 3840x2160 0.3% flake rate (30-day LUCI).

Resolves https://github.com/brave/brave-browser/issues/54521
2026-04-24 14:21:49 -04:00
Netzenbot 1d8fef4c06 Disable flaky Chromium test BrowserContextDestructionVsCookieRemoval (#35716)
The test All/BrowsingDataRemoverBrowserTestP.
BrowserContextDestructionVsCookieRemoval/* has a known upstream race
condition (crbug.com/413259587) between document.cookie and the
backend SiteDataCountingHelper query via GetAllCookies(). The test
expects GetSiteDataCount() == 1 immediately after SetDataForType, but
the mojo IPC from the renderer to the network service cookie store
may not have completed. Already disabled on Windows upstream. Upstream
LUCI Analysis shows 0.5% flake rate over 30 days; amplified in
Brave's MSAN builds. Brave has no modifications to the affected code
path (first-party cookie set and count).

Resolves https://github.com/brave/brave-browser/issues/54638
2026-04-23 16:02:28 -04:00
Netzenbot 94fae4024d Disable flaky Chromium test SaveToDriveEventDispatcherBrowserTest.Notify/0 (#35842)
This is an upstream Chromium test with a 3.7% flake rate (114k+ verdicts
over 30 days per Chromium LUCI Analysis). The /0 parameter variant
(OOPIF disabled) times out during QuitBrowsers in PostRunTestOnMainThread
teardown. The /1 variant (OOPIF enabled) is stable at 0.3%.

No Brave modifications exist in chrome/browser/save_to_drive/ — no
chromium_src overrides for this code area.

Resolves https://github.com/brave/brave-browser/issues/54240
2026-04-23 15:56:50 -04:00
Netzenbot 83c86129c1 Disable UpdateMetricsProviderBrowserTest.RunInBackground on all platforms (#35399)
Disable UpdateMetricsProviderBrowserTest.RunInBackground in cross-platform filter

Move the test from browser_tests-windows.filter to browser_tests.filter so it
is disabled on all platforms (Linux, macOS, Windows). The upstream flake affects
any platform where a previous test subprocess exits uncleanly.

Resolves brave/brave-browser#54247
2026-04-09 13:29:50 -04:00
Netzenbot 46d1e5e701 Fix MetricsUtilTest.DefaultValueTest on origin builds (#35388)
The test expected GetDefaultPrefValueForMetricsReporting() to return
true for beta/dev/nightly channels, but on origin-branded builds the
function unconditionally returns false (added in 2d48fb7f59). Update
the test expectations to account for IS_BRAVE_ORIGIN_BRANDED.

Resolves brave/brave-browser#54242
2026-04-09 07:44:47 -04:00
Netzenbot 7828959fab Fix intermittent AccountResolverDelegateImplUnitTest failure (#35279)
Fix intermittent AccountResolverDelegateImplUnitTest failures

Restricted address tests in ethereum_keyring_unittest.cc,
solana_keyring_unittest.cc, and filecoin_keyring_unittest.cc add addresses
to the BlockchainRegistry singleton's restricted list but never clean up.
When these tests run before ResolveAccountId or ValidateAccountId
(especially the filecoin test which uses the same kMnemonicDivideCruise
mnemonic), leaked restricted addresses cause CreateWalletInternal to fail
silently, leaving all keyrings null and causing every subsequent
EnsureAccount call to fail.

Also fix kAllKeyrings in test_utils.h which had duplicate kZCashMainnet
and kZCashTestnet entries instead of kBitcoinHardware and
kBitcoinHardwareTestnet.

Resolves brave/brave-browser#54213
Resolves brave/brave-browser#54214
2026-04-08 17:04:07 -04:00
Netzenbot 722af1759b Fix test: WebAppHelpers.Brave_IsValidWebAppUrl on origin builds (#35264)
The test asserts IsValidWebAppUrl(GURL("chrome://leo-ai")) returns true,
which relies on kInstallablePWAWebUIHosts containing "leo-ai". However,
kInstallablePWAWebUIHosts is only populated when BUILDFLAG(ENABLE_AI_CHAT)
is true. Origin builds set is_brave_origin_branded=true which sets
enable_ai_chat=false, so the hosts set is empty and the assertion fails.

Guard the test with #if BUILDFLAG(ENABLE_AI_CHAT) to match the production
code's guard in webui_url_constants.h.

Fixes https://github.com/brave/brave-browser/issues/53963
2026-04-08 09:45:48 -04:00
Netzenbot 4e57b251f7 Fix intermittent crash in TreeTabsBrowserTest.PinTab_PinnedCollectionAlreadyHasSplit (#35265)
* Fix intermittent crash in TreeTabsBrowserTest.PinTab_PinnedCollectionAlreadyHasSplit

TreeTabModel::AddTreeTabNode defers its kNodeCreated notification
via PostTask. On macOS, nested event loop pumping during UI
operations (tab activation, view creation) can cause this deferred
notification to fire at an unexpected time when tab views may not
yet exist or tabs may have been moved.

Two fixes:
1. BuildTreeTabs: call on_create callback after AddCollection so
   the tree node is in the collection tree when the deferred
   notification eventually fires. Previously on_create was called
   before AddCollection, meaning the tree node was not yet attached.
2. kNodeCreated handler: change CHECK_NE to graceful continue for
   kNoTab index, matching the existing pattern in kNodeWillBeDestroyed.
   This prevents a crash if the deferred notification fires after
   the tab has been moved (e.g., to pinned collection).

Fixes https://github.com/brave/brave-browser/issues/54161

* Add comment explaining kNoTab guard in kNodeCreated handler
2026-04-06 16:59:41 -04:00
Netzenbot d0eee2fc91 Disable flaky Chromium test PageStabilityMetricsTest.NetworkAndMainThreadIdle (#35281)
This upstream Chromium browser test intermittently fails in Brave
builds due to the same root cause as the already-disabled
PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed:
Brave's cosmetic filters inject a MutationObserver and setInterval
(500ms) polling on all pages, generating continuous renderer tasks
that prevent the IdlenessDetector's 500ms quiet window from completing
before the 4-second page stability timeout fires.

The test expects kNetworkAndMainThread outcome (bucket 1) but gets
kTimeout (bucket 5) because NetworkBecameIdle is never signaled.

Upstream flake rate is 1% over 30 days per LUCI Analysis. Not
disabled upstream. Brave modifications exist in the actor directory
via chromium_src but do not affect page stability monitoring.

Resolves https://github.com/brave/brave-browser/issues/54205
2026-04-06 16:58:50 -04:00
NetzenbotandBrian R. Bondy 8043aa1e1c Disable flaky ExtensionModuleApiTest.CognitoFile on startup timeout (#35287)
Disable flaky PersistentBackground/ExtensionModuleApiTest.CognitoFile/0

This Chromium test intermittently times out on Windows CI because
Brave's additional startup services keep the UI thread non-idle,
causing RunUntilIdle() to exceed the 30-second timeout. The test
exercises purely upstream extension module API code with no Brave
modifications. Upstream flake rate: 0.2% (stable).

Resolves https://github.com/brave/brave-browser/issues/54187

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-04-06 16:57:53 -04:00
Netzenbot 0cb89eac4c Disable flaky Chromium test PageStabilityMetricsTest.Paint on Windows (#35291)
Brave's cosmetic filters inject MutationObserver and setInterval(500ms)
polling on all pages, preventing Blink's IdlenessDetector from reaching
the 500ms quiet window needed for NetworkBecameIdle. The Paint test
waits for the network/main-thread idle histogram after paint stability
wins the race, but the idle task never fires due to continuous renderer
activity from cosmetic filters.

This is a Chromium test (chrome/browser/actor/tools/
page_stability_metrics_browsertest.cc). Not disabled upstream. Upstream
flake rate is 3.8% (LUCI Analysis, 30 days). Brave has chromium_src
overrides in chrome/browser/actor/ (site_policy.cc,
actor_proto_conversion.cc) but these do not affect page stability
monitoring. Same root cause as the already-disabled
PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed (Linux)
and PageStabilityMetricsTest.NetworkAndMainThreadIdle (Linux, PR #35281).

Resolves https://github.com/brave/brave-browser/issues/54186
2026-04-06 16:56:16 -04:00
NetzenbotandBrian R. Bondy a5c10e8491 Disable flaky Chromium test SaveToDriveEventDispatcherBrowserTest (#35278)
Disable Chromium test SaveToDriveEventDispatcherBrowserTest.GetFileMetadataStringForUploadInProgress/0

This is an upstream Chromium test with a known 3.4% flake rate
(112k+ verdicts over 30 days). The test times out during PDF
extension host loading in SetUpOnMainThread. No Brave modifications
exist in chrome/browser/save_to_drive/.

Resolves https://github.com/brave/brave-browser/issues/54219

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-04-05 18:09:06 -04:00
Netzenbot 253c786063 Disable flaky Chromium test BasicRedactionInIframe (#35275)
Disable Chromium test SensitivePaymentRedactionMultiSourcePageContextFetcherBrowserTest.BasicRedactionInIframe

Known upstream flake with 8.2% flake rate (30-day lookback from LUCI
Analysis). Race condition between autofill form classification and APC
(Annotated Page Content) extraction in cross-site iframe scenarios:
GetAutofillFieldData() returns nullopt when autofill hasn't cached the
iframe's form yet, causing no bounding boxes to be generated for
screenshot redaction. Not disabled by Chromium upstream. No Brave
chromium_src modifications in this code path.

Resolves https://github.com/brave/brave-browser/issues/54104
2026-04-05 10:02:15 -04:00
NetzenbotandBrian R. Bondy 0cd0ba8e8d Disable flaky Chromium test CopyLinkTextTouchTextOnly on Windows (#35274)
Disable Chromium test CopyLinkTextTouchTextOnly/LinkPreviewDisabled on Windows

This is an upstream Chromium test that intermittently times out
during browser startup on Windows CI. The test itself is trivially
simple (creates a context menu and checks a menu item), but the
failure occurs before the test body runs -- RunLoop::Run() times
out in ProxyRunTestOnMainThreadLoop during flush_startup_tasks.

Brave's additional startup initialization (AiChat, NTP background
images, stats updater, shields, etc.) adds overhead that can push
startup past the timeout on resource-constrained CI (32 parallel
jobs). Upstream flake rate is 0.3% (stable by Chromium standards).
Not disabled upstream. Brave modifies render_view_context_menu via
chromium_src but only adds menu items, unrelated to startup timing.

Added to browser_tests-windows.filter (platform-specific) since the
failure was only reported on Win x64.

Resolves https://github.com/brave/brave-browser/issues/54114

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-04-05 10:01:25 -04:00
Netzenbot a38262f2e1 Disable flaky Chromium test ObservationDelayControllerTest.UsePageStabilityForSameDocumentNavigation (#35266)
Disable Chromium test ObservationDelayControllerTest.UsePageStabilityForSameDocumentNavigation

This is an upstream Chromium test in chrome/browser/actor/tools/.
The test fixture sets kGlicActorPageStabilityTimeout to 30s to prevent
flakes but does not set kActorObservationDelayTimeout, which defaults
to 10s. On slow CI, the 10s overall timeout fires while still in
kWaitForPageStability, causing the state to skip kWaitForLoadCompletion
and jump directly to kDone.

Upstream LUCI Analysis shows 0.5% flake rate over 30 days. No Brave
chromium_src overrides affect the ObservationDelayController code path.

Fix: brave/brave-browser#54159
2026-04-04 23:30:29 -04:00
Netzenbot c30f306f62 Disable Chromium test GetDisplayMediaHiDpiBrowserTest.Capture/3840x2160 (#35267)
Brave's canvas farbling (PerturbPixels) modifies getImageData() results,
breaking this upstream Chromium test's canvas-based video playback
detection. The video_detector.js fingerprinting relies on stable pixel
data from getImageData(), which canvas farbling intentionally perturbs.

Not disabled by Chromium upstream. Upstream flake rate: 0.2% (30-day
LUCI). Other variants (Capture/0, Capture/1, Capture/640x480) are
already disabled for the same reason.

Resolves brave/brave-browser#54152
2026-04-04 23:29:07 -04:00
Netzenbot 8ad7d96046 Disable DevToolsTest.SourceMapsFromDevtools on Linux MSAN (#35263)
This is an upstream Chromium test. Stable upstream (0.3% flake rate
over 30 days per LUCI Analysis). The test evaluates a console
expression with a sourceMappingURL comment and waits for
SourceMapWillAttach to fire within a hardcoded 20-second JS timeout.
Combined with Brave's DevTools startup overhead (chromium_src
overrides, NTP/stats services), MSAN instrumentation causes the
DevTools frontend initialization to exceed this timeout.

Not disabled by Chromium upstream. Brave modifies DevTools via
chromium_src overrides (url_constants, features, devtools_ui_controller)
which add initialization overhead. No Brave modifications to the source
map manager or test code paths.

Resolves https://github.com/brave/brave-browser/issues/53990
2026-04-04 15:51:50 -04:00
Netzenbot acdaa9b894 Disable Chromium test GuestUtilBrowserTest.OnGuestAdded_Glic on Linux (#35260)
This Chromium test fails because the Glic WebUI creates its webview
asynchronously via JavaScript, and Brave's browser environment does
not fully support the Glic WebUI initialization flow. The test
navigates to chrome://glic/ and expects a guest view to be created,
but the async JS initialization sometimes fails to produce the
webview in Brave's context.

The test is stable upstream (0.3% flake rate per LUCI Analysis over
30 days). Not disabled by Chromium. No Brave chromium_src overrides
exist for glic or guest_view code. Failure is reported only on Linux.

Resolves https://github.com/brave/brave-browser/issues/54010
2026-04-04 13:39:10 -04:00
Netzenbot 2a26408b7b Disable flaky Chromium test CrashRecoveryBrowserTest.Reload on Windows (#35262) 2026-04-04 13:38:22 -04:00
Netzenbot a59c2d1fbe Fix FocusHandlerBrowserTest.ResultFile_WrittenForNormalProfile (#35102)
The test intermittently fails on Windows x64 ASAN builds because
Brave's tab_data.cc override unconditionally marks UNLOADED tabs with
should_show_discard_status=true. During browser startup, tabs briefly
have UNLOADED state before loading begins, which triggers the discard
ring IPH code path while BrowserUserEducationInterface is still in
kInitializationPending state.

Refine the check to only mark tabs as showing discard status when they
have a real committed navigation entry (not the initial entry). This
preserves the behavior for session-restored tabs and genuinely
discarded tabs while avoiding the IPH trigger during startup.

Resolves brave/brave-browser#54040
2026-04-04 09:18:14 -04:00
Netzenbot b602c4e091 Fix AutofillCounterTest.TimeRanges deadlock with FlushForTesting (#35108)
* Fix AutofillCounterTest.TimeRanges deadlock with FlushForTesting

Brave's background services (AI Chat, etc.) trigger D-Bus operations
during browser initialization. The D-Bus thread runs in the thread pool
and posts replies back to the main thread via PostTaskAndReply. The
upstream test calls ThreadPoolInstance::FlushForTesting() which blocks
the main thread, preventing D-Bus reply callbacks from executing, causing
a deadlock.

Replace FlushForTesting() with content::RunAllTasksUntilIdle() which
uses FlushAsyncForTesting + RunLoop to pump the main thread message loop
while waiting for thread pool completion, avoiding the deadlock.

Resolves https://github.com/brave/brave-browser/issues/54038

* Address review: use filter file instead of #define DISABLED_

Use test/filters/browser_tests-linux.filter to disable the upstream
TimeRanges test (D-Bus deadlock is Linux-specific). Rename our fixed
test to TimeRanges_BraveFixFlush to avoid name collision.

* Address review: disable test on Linux via filter only

Remove the chromium_src test override and keep only the filter file
entry to disable AutofillCounterTest.TimeRanges on Linux.
2026-04-04 09:16:43 -04:00
Netzenbot 075d771d5b Disable flaky Chromium test PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed (#35243)
Disable Chromium test PageStabilityMetricsMinWaitTest.NetworkAndMainThreadIdleDelayed

This upstream Chromium browser test intermittently fails in Brave
builds. The test relies on Blink's IdlenessDetector firing
NetworkBecameIdle, which requires 500ms of uninterrupted renderer
thread quiet time. Brave's cosmetic filters inject a MutationObserver
and setInterval(500ms) polling on all pages, generating continuous
renderer tasks that prevent the quiet window from completing.

The upstream flake rate is 1.1% over 30 days per LUCI Analysis, and
Brave's always-on cosmetic filter scripts exacerbate the flakiness
significantly.

Resolves https://github.com/brave/brave-browser/issues/54021
2026-04-04 09:16:06 -04:00
NetzenbotandBrian R. Bondy f4e0d48f1f Disable Chromium test InitialWebUIMetricsDropBrowserTest on Linux MSan (#35240)
This upstream Chromium test fails on Linux MSan builds. Chromium has
already disabled it on ChromeOS MSan (crbug.com/491012584). The test
has a 2.7% upstream flake rate (LUCI Analysis, 30-day lookback) due to
stale histogram samples from non-Webium renderers leaking into the
HistogramTester baseline when FetchHistogramsFromChildProcesses() is
called. Under MSan instrumentation, the kInitialWebUI feature (WebUI
toolbar) navigation hangs in Brave, causing the test to time out.

Resolves https://github.com/brave/brave-browser/issues/54030

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-04-04 09:15:20 -04:00
Netzenbot 872c8a2fd5 Disable flaky Chromium test NormalRendererMetricsAreNotMapped on Linux MSan (#35237)
Disable Chromium test NormalRendererMetricsAreNotMapped on Linux MSan

This is an upstream Chromium test with a 2.9% flake rate (LUCI
Analysis, 30 days). Chromium has already disabled it on ChromeOS MSan
(crbug.com/491012584). The test asserts zero samples for the renamed
Webium histogram in a non-initial-WebUI renderer, but pending
histograms from the browser's initial WebUI startup process can leak
into the measurement under slow MSan execution.

No Brave modifications exist in chrome/browser/ui/waap/.

Resolves https://github.com/brave/brave-browser/issues/54031
2026-04-04 09:13:27 -04:00
Netzenbot 0d1acf07f9 Disable AccessibilityLabelsMenuObserverTest on Windows ASAN (#35236)
This Chromium test intermittently fails on Windows ASAN due to
IPH_DiscardRing attempting to show before browser initialization
completes, producing a LOG(ERROR) that causes test failure. The error
is unrelated to the accessibility labels code under test.

Brave suppresses AddAccessibilityLabelsServiceItem entirely, so this
test exercises disabled functionality. The test is stable upstream
(0.3% flake rate per LUCI Analysis). Chromium already disables this
test suite on Linux (accessibility-linux.browser_tests.filter).

Using a Windows-ASAN-specific filter file since the failure is only
reported on that configuration.

Resolves https://github.com/brave/brave-browser/issues/54036
2026-04-04 09:12:24 -04:00
Netzenbot 9a4d0c185c Disable Chromium test TemplateURLPrepopulateDataUpdateRequirements EngineDowngrade variants (#35247)
Disable UpToDateMetadataWithEngineMigrationDowngrade and
DifferentCountryWithEngineMigrationDowngrade test cases in
components_unittests.

These are upstream Chromium tests that fail because Brave overrides
GetDataVersion() to add kBraveCurrentDataVersion (32) to the upstream
version. The test uses raw kCurrentDataVersion for db_version, so
db_version < GetDataVersion() always triggers the version upgrade
path instead of returning nullopt.

These two test cases were missed in previous filter additions because
they have hits_dcheck=true and take the death-test path in debug
builds. In official/nightly builds (DCHECK off), they fall through
to EXPECT_EQ and fail due to the version mismatch.

Stable upstream (0% flake rate over 30 days, 302K+ verdicts).
Brave modifies components/search_engines/ via chromium_src
(template_url_prepopulate_data.cc GetDataVersion override).
Same root cause as the 7 other already-filtered tests from this suite.

Resolves https://github.com/brave/brave-browser/issues/54012
2026-04-04 09:10:46 -04:00
Netzenbot 02f453bf50 Disable BrowsingTopics by stubbing out BrowsingTopicsServiceImpl (#34969)
* Disable BrowsingTopics by stubbing out BrowsingTopicsServiceImpl

Instead of relying on the kBrowsingTopics feature flag to disable
BrowsingTopics, stub out BrowsingTopicsServiceFactory in chromium_src
so the service is never created regardless of feature flag state.

- Override BrowsingTopicsServiceFactory to always return nullptr
- Remove kBrowsingTopics feature flag override (no longer needed)
- Update test filters to cover all BrowsingTopics browser tests
- Update renderer comment to reflect new disabling approach

Resolves https://github.com/brave/brave-browser/issues/53825

* Fix copyright year and add missing deleted move operators

* Address review: use #define include pattern instead of full file replacement

Replace full chromium_src file overrides with the minimal #define +
#include pattern. Only BuildServiceInstanceForBrowserContext is
overridden to return nullptr; all other factory methods use the
upstream implementation.

* Address review: simplify to filter-only changes

Remove chromium_src overrides for BrowsingTopicsServiceFactory — the
upstream factory already returns nullptr when kBrowsingTopics is
disabled via feature flag. Only update test filter files to use
wildcard patterns for all BrowsingTopics-related tests.
2026-04-02 13:43:34 -04:00
Netzenbot 9c8462ef86 Fix test: AIChatConversationTaskBrowserTest.TaskUI (#34754)
* Fix test: AIChatConversationTaskBrowserTest.TaskUI

The Leo Button component (SvelteToReact wrapper) attaches its click event
listener asynchronously via useEffect, after browser paint. On macOS, the
paint can be delayed enough that the click listener is not yet attached when
ClickElement fires, causing pauseTask() to never be called and the RunUntil
for kPaused to time out.

Fix by calling conversation_handler_->PauseTask() directly instead of going
through the UI click path. The direct C++ call is reliable and synchronous,
eliminating the timing window. The UI click path is already tested by
TaskPauseResumeActions.

Resolves https://github.com/brave/brave-browser/issues/53695

* Address review: add TODO for SvelteToReact async listener issue

Updated workaround comment to accurately describe the root cause:
the SvelteToReact wrapper in @brave/leo attaches click listeners
asynchronously via useEffect. Filed brave/leo#1343 to fix it at
the source, and added a TODO referencing that issue.
2026-04-01 10:18:32 -04:00
Netzenbot e71a6003b6 Fix AppInfoDialogBrowserTest.InvokeUi_default failure (#35115)
Brave's tab_data.cc override was incorrectly marking all UNLOADED
tabs as having discard status, including tabs that had never loaded
(e.g. during browser initialization). This triggered TabIcon to
attempt showing the IPH_DiscardRing promo before the browser's
user education interface was initialized, causing a LOG(ERROR)
and test failure on Windows ASAN builds.

The fix adds a WasDiscarded() check so only tabs that were actually
discarded get the discard status indicator, not tabs that simply
haven't loaded yet.

Resolves https://github.com/brave/brave-browser/issues/54037
2026-04-01 10:10:25 -04:00
Netzenbot 2e11af7fa4 Disable DevToolsExtensionHostsPolicyTest.CantInspectBlockedHost on MSAN (#35097)
Upstream Chromium test, stable upstream (0.9% flake rate over 30
days per LUCI Analysis). The test runs 10 eval retries with
exponentially increasing timeouts (~10s total wall-clock time).
Under MSAN instrumentation combined with Brave's additional DevTools
startup overhead (chromium_src overrides, NTP/stats services), this
exceeds the test's hardcoded 20-second timeout. The sibling test
CantInspectBlockedSubdomainHost is already disabled in the upstream
source for the same reason.

Resolves brave/brave-browser#54053
2026-03-31 16:21:23 -04:00
Netzenbot 5e8d811db7 Fix flaky BlobUrlPartitionEnabledBrowserTest blob cleanup (#35003)
* Fix flaky BlobUrlPartitionEnabledBrowserTest blob cleanup

After closing a tab, the Mojo associated pipe disconnect for
BlobURLStoreImpl goes through BrowserThread::IO (pipe closure
detection) before the disconnect handler is posted to the UI thread.
RunAllTasksUntilIdle() only flushes the UI thread and thread pool
but not the IO thread, so the blob URL mapping removal may not
complete before the test checks accessibility.

Add an IO thread flush via PostTaskAndReply before
RunAllTasksUntilIdle() to ensure disconnect notifications are
delivered and processed deterministically.

Resolves brave/brave-browser#53892

* Address review: use RunAllPendingInMessageLoop(IO) instead of manual flush

Replace the ad-hoc PostTaskAndReply IO thread roundtrip with Chromium's
established content::RunAllPendingInMessageLoop(BrowserThread::IO)
utility. This is more robust (multiple flush iterations via
kNumQuitDeferrals) and is the standard pattern used in Chromium's own
test infrastructure for the same IO→UI disconnect synchronization.

Resolves brave/brave-browser#53892
2026-03-31 16:18:23 -04:00
Netzenbot 5e81bc67d5 Disable ImageNavigationThrottleTest.SubresourceLoadSucceeds on Windows (#35100)
This Chromium test fails consistently on Windows ASAN nightly builds.
The test verifies that chrome://image subresource loads work by creating
an HTTPS embedded test server and loading an image through
SanitizedImageSource. The browser-process URL loader fails to download
from the test server under ASAN, likely due to cert trust issues.

The test is stable upstream (0.3% flake rate per LUCI Analysis).
Brave does not modify SanitizedImageSource, ImageNavigationThrottle,
or the chrome://image data source. The production feature works correctly
(wallet and other WebUIs load images via chrome://image without issues).

Resolves https://github.com/brave/brave-browser/issues/54041
2026-03-31 16:11:11 -04:00
Netzenbot 0a61eaf3dd Disable Chromium test NotificationContentDetectionServiceFactoryBrowserTest.DisabledForGuestMode (#35098)
This is an upstream Chromium test that fails intermittently on
Windows x64 ASAN builds. The test creates a standalone TestingProfile
in a browser test context, which triggers Brave's additional keyed
services and causes intermittent ASAN-detected issues during profile
lifecycle. The test is stable upstream (0.3% flake rate per LUCI
Analysis). Not disabled by Chromium.

Resolves https://github.com/brave/brave-browser/issues/54043
2026-03-31 15:57:43 -04:00
Netzenbot 9f1db1e854 Disable Chromium test ChromeDataUseMeasurementBrowserTest.DataUseRecorded (#35105)
This is an upstream Chromium test that consistently times out in Brave.
The test's busy-wait loop (RunUntilIdle + FetchHistogramsFromChildProcesses)
hangs because Brave's background tasks from extensions and shields keep the
UI thread non-idle, preventing RunUntilIdle from completing.

The underlying DataUse histogram recording works correctly - verified by
calling FetchHistogramsAsynchronously directly, which returns total=1569
bytes of data use. The issue is purely in the test's retry mechanism.

Upstream flake rate: 0.3% (stable). No Brave chromium_src overrides
affect the data use measurement code path.

Resolves https://github.com/brave/brave-browser/issues/54039
2026-03-31 15:22:37 -04:00
Netzenbot d0b5bc397c Disable flaky Chromium NotificationContentDetection test (#35099)
Disable Chromium test NotificationContentDetectionAllowlistedChecksEnabledBrowserTest.NotificationDisplayedWhenModelNotAvailable

This is an upstream Chromium test (stable upstream at 0.2% flake rate).
Brave's stubbed PredictionManager and disabled optimization guide
features cause incompatibility with this test. All other tests in the
NotificationContentDetection family are already disabled for the same
reason. Not disabled by Chromium upstream.

Resolves https://github.com/brave/brave-browser/issues/54042
2026-03-31 13:53:02 -04:00
Netzenbot 70a318628b Disable flaky Chromium test WorkerTest.WorkerInBackgroundPage (#35095)
This is an upstream Chromium test (chrome/browser/extensions/worker_apitest.cc)
that intermittently times out when the last crossOriginRedirectTest
(SharedWorker with module type) fails to fire its onerror handler.

Chromium upstream flake rate: 2.4% over 30 days (LUCI Analysis).
Already disabled on Windows ASAN (crbug.com/431290255).

Brave has chromium_src overrides for worker content settings and fetch
context, but they don't touch the worker script redirect/loading path
that's failing. The root cause is upstream timing sensitivity in
SharedWorker module cross-origin redirect error propagation.

Resolves https://github.com/brave/brave-browser/issues/54061
2026-03-31 09:14:25 -04:00
Netzenbot dd63bc12ba Disable ExtensionInstallPolicyServiceTest.CanInstallExtensionServerUnreachable because of high flake rate (#34942)
Disable flaky ExtensionInstallPolicyServiceTest.CanInstallExtensionServerUnreachable

Upstream test has a 14% flake rate. Disable in filter file
instead of attempting a code fix.

Issue: https://github.com/brave/brave-browser/issues/53781
2026-03-25 08:53:07 -04:00
Netzenbot c4d08dd3a3 Disable DevToolsTest.TestShowRecorderTab under MSAN (#34962)
The recorder panel's heavy initialization (~20 module imports,
LitElement setup, extension system), combined with Brave's additional
DevTools startup overhead, exceeds the test's hardcoded 20-second
timeout under MSAN instrumentation. Stable upstream (0.2% flake rate
over 30 days per LUCI Analysis).

Resolves https://github.com/brave/brave-browser/issues/53812
2026-03-25 08:47:39 -04:00
Netzenbot e38f0fc98c Fix intermittent ContainersBrowserTest.MixedTabsPersistence (#34921)
Fix intermittent ContainersBrowserTest.MixedTabsPersistence failure

After session restore, background tabs use deferred loading and may not
have loaded their pages yet. The test was calling EvalJs to read
document.cookie on restored tabs without ensuring they were loaded,
causing a SecurityError on unloaded tabs with opaque origins.

Fix: Activate each tab and wait for load stop before accessing content,
following the standard Chromium session restore test pattern.

Resolves brave/brave-browser#53772
2026-03-25 08:45:30 -04:00
Netzenbot 789bb611b6 Disable flaky InstallableManagerBrowserTest.CheckWebapp on Windows (#34872)
* Disable flaky InstallableManagerBrowserTest.CheckWebapp on Windows ASAN

This Chromium test fails intermittently on Windows x64 ASAN builds.
ManifestSilentUpdateCommand queues a background GetData() task whose
FinishAndStartNextTask cleanup may still be pending when HasCurrent()
is asserted after run_loop.Run() completes. ASAN overhead widens
the race window.

Upstream LUCI Analysis shows 0.6% flake rate (30 days). No Brave
modifications to the installable manager code path.

Resolves https://github.com/brave/brave-browser/issues/53717

* Address review: move filter to browser_tests-windows.filter

Move InstallableManagerBrowserTest.CheckWebapp from the ASAN-only
filter to the general Windows filter since the upstream flake rate
is not limited to ASAN builds.
2026-03-25 08:44:23 -04:00
Netzenbot d0163c7f97 Disable flaky Chromium LayoutInstabilityTest.* on Windows (#34957)
* Disable flaky Chromium test LayoutInstabilityTest.SimpleBlockMovement on Windows

This is an upstream Chromium test that intermittently times out when the
PageLoadMetricsTestWaiter waits for layout shift IPC from the renderer.
Chromium disables all LayoutInstabilityTest.* on all platforms in their
CFT filter files. Already disabled on Linux in Brave. Upstream flake
rate: 0.3% over 30 days per LUCI Analysis, increasing to ~1% recently.

Brave has no chromium_src overrides for LayoutShiftTracker,
PageTimingMetricsSender, MetricsWebContentsObserver, or PageLoadTracker.
The Brave PerfPredictorPageMetricsObserver does not interact with layout
shift data.

Resolves brave/brave-browser#53785

* Update filter to disable all LayoutInstabilityTest.* on Windows

Match the Linux filter wildcard and upstream Chromium CFT filters
which disable all LayoutInstabilityTest.* on all platforms. Also
clarify comment to reflect upstream STABLE verdict while noting
Chromium still disables in CFT.
2026-03-24 15:01:09 -04:00
Netzenbot 4c85540ecd Fix duplicate review comments from cross-chunk deduplication (#34908) 2026-03-24 10:40:58 -04:00
Netzenbot f45a03fd0b Disable flaky BrowsingTopicsInternalsBrowserTest.ClassifierTab (#34867)
Disable Chromium tests ClassifierTab and ClassifierTab_ModelUnavailable
via filter file. These tests have an inherent race condition in
TestAnnotator's async model info callback. Chromium has also disabled
these tests upstream with DISABLED_ prefix. No Brave modifications
exist in the browsing_topics code path. Upstream flake rate: 0.3%
per LUCI Analysis (30 day lookback).

Resolves https://github.com/brave/brave-browser/issues/53618
2026-03-20 13:08:44 -04:00
Netzenbot 5bb907f22d Add best practices doc for handling upstream docs (#34864)
Add upstream test failures best practices doc

Consolidates upstream-flake filter guidance from testing-isolation.md
(TI-031, TI-032, TI-041, TI-042, TI-043) and patches.md (PATCH-011)
into a dedicated testing-upstream-failures.md. Expands the flake-check
section with full script usage and the LUCI verdict table.
2026-03-20 12:22:23 -04:00
Netzenbot 249704cfca Rename BEST-PRACTICES.md to best_practices.md (#34861)
Update all internal references in skill docs.
2026-03-20 11:23:36 -04:00
Netzenbot 1ae9b6fa89 Fix intermittent trezor_bridge_keyring test failures (#34658)
The 'Bridge not ready' test was creating a real iframe in jsdom via the
unmocked createBridge method. The iframe's onload event could fire
asynchronously at non-deterministic times, causing the pending
createBridge promise to resolve during a subsequent test. When the old
async executor resumed, it interfered with the currently running test,
causing all tests that use sendCommandToTrezorFrame to fail with
BridgeNotReady.

Fix by mocking createBridge in the 'Bridge not ready' test to use a
lightweight div element (to satisfy hasBridgeCreated) and return a
never-resolving promise, avoiding jsdom iframe side effects while
preserving the test's intent.

Resolves https://github.com/brave/brave-browser/issues/53483
2026-03-20 10:46:04 -04:00
Netzenbot b666899f39 Fix null StructPtr dereference in wallet test AccountUtils (#34720)
fix: Remove unsafe ->Clone() on potentially null AccountInfoPtr

Three AccountUtils methods (CreateDerivedAccount, CreateImportedAccount,
CreateHardwareAccount) called ->Clone() on the return value of
AddAccountSync/ImportBitcoinAccountSync/AddBitcoinHardwareAccountSync
without null-checking first. When these functions return null (e.g. if
HD key derivation fails), operator->() triggers DCHECK(ptr_) in
struct_ptr.h:85, causing an intermittent crash in
FilTxManagerUnitTest.ProcessHardwareSignatureError during SetUp.

The Clone() calls were also unnecessary since these functions already
return owned AccountInfoPtr values, not references to cached data.

Resolves brave/brave-browser#53572
2026-03-14 14:34:18 -04:00
Netzenbot 2d614e632f Add missing brave_news buildflags dep to chromium_src/chrome/browser/ui (#34662)
The chromium_src override of toolbar_view.cc includes
brave_location_bar_view.h, which unconditionally includes
brave/components/brave_news/common/buildflags/buildflags.h.
The build target was missing an explicit dependency on the
brave_news buildflags, causing intermittent build failures
when the header wasn't already generated via a transitive path.

Resolves brave/brave-browser#53536
2026-03-12 20:24:44 -04:00
Netzenbot 29d1c70790 Disable All/GetDisplayMediaHiDpiBrowserTest.Capture/1 (#34531)
This upstream Chromium test intermittently fails in Brave (issue
#53422). The test detects video playback via canvas getImageData()
fingerprinting which Brave's canvas farbling (PerturbPixels) modifies.
The sibling variant Capture/0 is already disabled for the same reason.

Stable upstream: Capture/0 1.1%, Capture/1 0.2% flake rate (30-day
LUCI Analysis).

Resolves https://github.com/brave/brave-browser/issues/53422
2026-03-07 12:13:48 -05:00
Netzenbot 4b1c437d6b Disable flaky Chromium test DefaultBrowserManagerWinBrowserTest (#34530)
Disable flaky Chromium test DefaultBrowserManagerWinBrowserTest.ClickAcceptTriggersSetterAndMetric

This is an upstream Chromium test with a 1.8% flake rate over 30 days
per LUCI Analysis. The failure is a COM interface reference leak
(CheckForLeakedAxPlatformNodes detects ghost_count=1) in the
notification accessibility tree during test teardown, not a test logic
failure.

Brave's chromium_src overrides only replace DefaultBrowserWorker with
BraveDefaultBrowserWorker, which is unrelated to accessibility/COM node
cleanup.

Resolves https://github.com/brave/brave-browser/issues/53421
2026-03-06 14:16:43 -05:00
Netzenbot b8896521e0 Disable flaky SharedStorageManagerErrorParamTest InMemoryOnly variant (#34527)
Add InMemoryOnly variant to components_unittests filter alongside the
already-filtered FileBacked variant. Both share the same root cause:
MOCK_TIME auto-advances the PurgeStale timer during TestFuture::Take(),
consuming an extra entry from the mock result queue and triggering a
DCHECK. ~1% flake rate per LUCI Analysis over 30 days.

Resolves https://github.com/brave/brave-browser/issues/53415
2026-03-06 13:59:34 -05:00
Netzenbot 5623e542f0 Fix intermittent EngineConsumerOAIUnitTest time race (#34441)
The GenerateAssistantResponseWithDefaultSystemPrompt test computes
expected_system_message using base::Time::Now(), then production
code calls base::Time::Now() again inside BuildSystemMessage(). If
these two calls cross a second boundary, the formatted time strings
differ causing assertion failure.

Fix: Use MOCK_TIME in TaskEnvironment so both calls return the same
deterministic time value.

Resolves https://github.com/brave/brave-browser/issues/53366
2026-03-04 22:05:26 -05:00
NetzenbotandSimon Hong cf867366ac Remove minimize/restore from split view modal dialog test (#34347)
* Fix split view tab_is_active_ correction for permission manager

The BRAVE_PERMISSION_REQUEST_MANAGER_ON_VISIBILITY_CHANGED macro that
calls UpdateTabIsHiddenWithTabActivationState() is unreachable on
desktop because OnVisibilityChanged() returns early when
tab_subscriptions_ is not empty. This means OnTabActiveStateChanged()
was calling OnVisibilityChanged() expecting the correction to run, but
it never did on desktop.

Additionally, UpdateTabIsHiddenWithTabActivationState() only corrected
tab_is_active_ in one direction (true->false for inactive split tabs)
but not the reverse (false->true for the active split tab).

Fix by calling UpdateTabIsHiddenWithTabActivationState() directly from
OnTabActiveStateChanged() instead of through the unreachable macro, and
make the correction bidirectional so tab_is_active_ always matches the
split view activation state.

Resolves https://github.com/brave/brave-browser/issues/53276

* Fix IsWebContentsVisible for split view dialog visibility

Address review feedback: the test failure is about web modal dialog
visibility, not permission bubbles. The root cause is that after
Minimize()+Restore(), platform_util::IsVisible() can temporarily
return false for the active split tab. This caused the Brave macro
in WebContentsModalDialogManager::OnVisibilityChanged() to swallow
the HIDDEN->VISIBLE transition, preventing ShowNextDialog() from
being called.

Fix: Use tab->IsActivated() as the source of truth for split view
tabs in BraveBrowser::IsWebContentsVisible(), which is always
accurate regardless of platform visibility timing. Revert the
PermissionRequestManager changes from the previous attempt.

Resolves brave/brave-browser#53276

* Updated test code

Removed window minimize/restored state during the test.
This window change is not important factor for split tab's
modal dialog test.
Claude code suspects that minimize/retored state change could
make platform_util::IsVisible(). Let's see this intermittent test
failure happens again w/o window state change.

---------

Co-authored-by: Simon Hong <shong@brave.com>
2026-03-04 17:43:26 -05:00
NetzenbotandClaude Opus 4.6 01f6d7a871 Disable flaky DevToolsProcessPerSiteTest.PausedDebuggerFocus on Linux (#34425)
The test intermittently times out due to a race condition in the
DevTools frontend async chain (DebuggerPaused → SourcesPanel module
loading → bringToFront IPC). Already disabled upstream on Windows ASAN
(crbug.com/337141755) with 0.2% flake rate per LUCI Analysis. No
Brave-specific code affects this path.

Resolves https://github.com/brave/brave-browser/issues/53358

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 08:14:19 -05:00
Netzenbot 3ff0c23ad0 Disable Chromium test RuntimeGetContextsApiTest.GetServiceWorkerContext (#34365)
This is an upstream Chromium test
(chrome/browser/extensions/api/runtime/runtime_apitest.cc) that crashes
with a segmentation fault on Linux x64 nightly builds (issue #53280).

The test is already disabled on Mac upstream (IS_MAC). Upstream LUCI
Analysis shows occasional failures in the android_browsertests variant
(1.4% flake rate, increasing to 5-6% in late February/March 2026),
while the browser_tests desktop variant shows 0.3% flake rate.

No Brave chromium_src overrides exist for ProcessManager, service
worker lifecycle, or the chrome.runtime.getContexts() API, so this
failure is not caused by Brave-specific modifications.

Another test from the same fixture (GetOffscreenDocumentContext) is
already disabled in this filter file.
2026-03-02 14:16:53 -05:00
NetzenbotandBrian R. Bondy 9f626444ef Disable flaky upstream test AutoPictureInPictureTabHelperBrowserTest.PromptResultRecorded_VideoConferencingAllowOnce (#34364)
Disable flaky Chromium test AutoPictureInPictureTabHelperBrowserTest.PromptResultRecorded_VideoConferencingAllowOnce

This is an upstream Chromium test with a 10.5% flake rate over 30 days
per LUCI Analysis. The crash is a null pointer dereference in
AutoPipSettingView::OnButtonPressed when the widget is destroyed before
the test can interact with the bubble view.

Brave does not modify any code in the auto picture-in-picture path.
Multiple other tests from the same test suite are already disabled in
the filter file for similar reasons.

Resolves https://github.com/brave/brave-browser/issues/53277

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-03-02 14:08:05 -05:00
NetzenbotandClaude Opus 4.6 5d80fd8a18 Fix flaky BraveWalletSignMessageBrowserTest.SIWE test (#34285)
* Fix flaky BraveWalletSignMessageBrowserTest.SIWE test

The SIWE test sends two sign messages per iteration: one with matching
origin and one with a different origin ("www.a.com"). The second message
is rejected immediately by the provider, overwriting the global
signMessageResult variable with an error. After
NotifySignMessageRequestProcessed approves the first message, the test
immediately checked signMessageResult, but the mojo approval response
may not have been delivered to the renderer yet, so signMessageResult
still contained the rejection error.

Fix by replacing the immediate getSignMessageResult() check with a
Promise-based wait that polls until signMessageResult is a string
starting with "0x" (the signature). This is safe because both the
rejection and approval go through the same mojo interface, so the
rejection always arrives before the approval.

Resolves https://github.com/brave/brave-browser/issues/53167

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address review: fix same race condition in other sign message tests

Apply the same async polling pattern to UserApprovedRequest and
UserRejectedRequest tests, which had the same race condition of
calling getSignMessageResult() immediately after
NotifySignMessageRequestProcessed() without waiting for the mojo
response to arrive at the renderer.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 13:12:55 -05:00
Netzenbot 95f991747e Fix leaked raw_ptr/raw_ref in BraveOriginService (#34275)
Override KeyedService::Shutdown() to clean up raw_ptr members and
invalidate weak pointers before the service is destroyed. Without
this, the defaulted destructor detects dangling raw_ptr references
to PrefService and PolicyService objects that are already freed
during the profile teardown sequence.

Resolves https://github.com/brave/brave-browser/issues/52757
2026-03-01 13:11:02 -05:00
NetzenbotandBrian R. Bondy e32e93e830 Disable flaky AutoPictureInPictureTabHelperBrowserTest.PromptResultRecorded_VideoConferencingAllowOnce (#34338)
This Chromium test has a 10.9% upstream flake rate (111,249 verdicts in
LUCI Analysis). The crash is in upstream code (AutoPipSettingView::
OnButtonPressed) due to a race condition between PostTask-deferred
ShowBubble() and the test accessing the view before the posted task
runs. No Brave modifications exist for this code path.

Resolves https://github.com/brave/brave-browser/issues/53186

Co-authored-by: Brian R. Bondy <netzen@gmail.com>
2026-02-28 15:56:08 -05:00
Netzenbot 68cff69a2d Disable Chromium test AutoPictureInPictureTabHelperBrowserTest.OverlaySettingViewIsShownForDocumentPip (#34337)
This is an upstream Chromium test that crashes with a null pointer
dereference in ASAN builds. The root cause is a race condition where
ShowBubble() is deferred via PostTask in AddedToWidget(), so
auto_pip_setting_view_ may still be null when the test accesses it.

Upstream flake rate: 4.7% overall, 12-13% recently (LUCI Analysis).
Already disabled on Linux upstream since Nov 2023 (crbug.com/1500939).
Brave does not modify the PIP code paths involved.

Resolves brave/brave-browser#53185
2026-02-28 15:54:59 -05:00
Netzenbot c9936e8018 Disable flaky upstream test AutoPictureInPictureTabHelperBrowserTest.OverlaySettingViewIsShownForDocumentPip (#34336)
Disable Chromium test AutoPictureInPictureTabHelperBrowserTest.OverlaySettingViewIsShownForDocumentPip

This is an upstream Chromium test that crashes with a null pointer
dereference in ASAN builds. The root cause is a race condition where
ShowBubble() is deferred via PostTask in AddedToWidget(), so
auto_pip_setting_view_ may still be null when the test accesses it.

Upstream flake rate: 4.7% overall, 12-13% recently (LUCI Analysis).
Already disabled on Linux upstream since Nov 2023 (crbug.com/1500939).
Brave does not modify the PIP code paths involved.

Resolves brave/brave-browser#53185
2026-02-28 07:41:53 -05:00
Netzenbot abe1743279 Fix crash: TabStripModel reentrancy in split view focus during tab close (#34198)
Fix reentrancy crash in split view focus handling during tab close

On macOS, closing a split view detaches a web contents native view
which can synchronously trigger a focus change via AppKit first
responder transfer. This focus event propagates through
OnWebContentsFocused to ActivateTabAt(), but when called from within
CloseAllTabs() the TabStripModel reentrancy guard fires causing a
crash.

Guard WebContentsFocused to skip tab activation when closing_all()
is true, preventing the reentrancy violation.

Fixes https://github.com/brave/brave-browser/issues/53121
2026-02-26 07:37:59 -05:00
Netzenbot f2ad0c1142 Fix flaky AIChatRenderViewContextMenuBrowserTest.RewriteInPlace_InputText (#34118)
The wait_for_text() JavaScript function in rewrite.html used only a
MutationObserver to detect text changes. MutationObserver observes DOM
node mutations (childList, subtree, characterData) but does NOT observe
.value property changes on <input> and <textarea> elements. When the
Replace() IPC updates an input element's value asynchronously, the
MutationObserver never fires, causing EvalJs to time out.

Add an 'input' event listener alongside the MutationObserver so that
value changes on form elements are properly detected. MutationObserver
continues to handle contenteditable elements. A resolved flag prevents
duplicate resolution.

Resolves brave/brave-browser#53073
2026-02-23 19:06:53 -05:00
Netzenbot c031c5797b Add null-safety guards to NonClientHitTest for Mac window teardown crash (#33981)
* Add null-safety guards to NonClientHitTest for Mac window teardown crash

On Mac, AppKit can trigger hit tests via windowDidBecomeKey:/
makeKeyAndOrderFront: during window teardown or fullscreen transitions,
while the widget is in a partially destroyed state. This causes an
invalid memory access crash in BrowserView::NonClientHitTest (crash #8
by volume, ~8,440 crashes in 7 days, issue brave/brave-browser#52876).

Add defensive null checks in three locations:
- BraveBrowserFrameViewMac::NonClientHitTest: early return if widget is
  null or closed
- BRAVE_BROWSER_VIEW_LAYOUT_CONVERTED_HIT_TEST macro: null-check both
  src and dst widgets before comparing them
- brave::NonClientHitTest: null-check GetWidget() before accessing
  GetRootView()

* Address review: add browser_view null check at start of NonClientHitTest

Per review feedback, use the fact that GetBrowserView() can return
nullptr during teardown (documented in BrowserFrameView::GetBrowserView)
to guard at the entry of brave::NonClientHitTest() instead of checking
GetWidget() mid-function.
2026-02-19 16:48:15 -05:00
Netzenbot c44428ac2a Disable flaky Chromium test SharedStorageManagerErrorParamTest.OtherOperationResults_NoErrorsAdded (#34042)
Same root cause as InitFailure_DestroyAndRecreateDatabase (disabled in
#33880): DCHECK failure in MockResultQueue::NextOperationResult due to
mock result queue race condition during SharedStorageManager
construction (crbug.com/40831552).

Chromium upstream data: 0.8% flake rate over 30 days (1495 flaky
verdicts out of 193800) per LUCI Analysis. Already disabled on Android
upstream (crbug.com/1312044). No Brave-specific modifications to the
SharedStorageManager component.

Resolves https://github.com/brave/brave-browser/issues/52941
2026-02-18 14:37:40 -05:00
Netzenbot ddd8ae6c19 Disable Chromium test IsolatedWebAppManagedAllowlistTest.NotAllowedAppInstallationRefused (#33991)
The sibling test AllowedAppInstalled from the same class is already
disabled because Brave disables Isolated Web Apps. This test has the
same root cause: the IWA component installation flow in the test
fixture races with the test's own UpdateKeyDistributionInfo call,
causing a CHECK failure when the async component callback fires with
a mismatched version.

Upstream LUCI Analysis shows a 3.8% flake rate over 30 days. No Brave
chromium_src overrides exist for IWA policy management code.

Resolves https://github.com/brave/brave-browser/issues/52916
2026-02-17 08:30:33 -05:00
Netzenbot 8345f7129a Disable Chromium test ExtensionBackForwardCacheBrowserTest.ChromeTabsConnectWithMultipleReceivers (#33990)
Move ServiceWorker/ExtensionBackForwardCacheBrowserTest.
ChromeTabsConnectWithMultipleReceivers/0 from browser_tests-linux.filter
to browser_tests.filter since the test also fails on Windows ASAN
(brave/brave-browser#52915). The EventPage variant was already disabled
in the main filter. This is an upstream Chromium test that is stable
upstream (0.1% flake rate) but crashes in Brave builds due to
BFCache behavior differences with extensions.
2026-02-17 07:22:22 -05:00
Netzenbot bb28707484 Fix intermittent ContainersBrowserTest.ShouldShowTabAccent (#33976)
Add RunScheduledLayouts() before checking ShouldShowLargeAccentIcon()
to ensure the tab strip layout is complete and the tab has correct
dimensions. ShouldShowLargeAccentIcon() depends on the tab's width(),
which may not be set yet if the Views layout pass hasn't run after
adding the new container tab.

Resolves brave/brave-browser#52824
2026-02-17 06:53:39 -05:00
Netzenbot cced030c13 Disable flaky Chromium test SocketApiTest.SocketTCPExtension (#33980)
This is an upstream Chromium test with a 7.4% flake rate in LUCI
Analysis (30-day lookback, 78668 verdicts). Already disabled on
Windows by Chromium (crbug.com/1319604).

The test intermittently fails in testPendingCallback because the TCP
read returns only the HTTP headers without the body when the response
arrives in multiple TCP segments. Brave's chromium_src socket changes
(SOCKS5/SSL) are unrelated to the extension TCP socket API.

Resolves https://github.com/brave/brave-browser/issues/52872
2026-02-16 20:51:14 -05:00
Netzenbot b2087e2d6a Disable flaky upstream test AnonymousTokensRsaBssaClientWithPublicMetadataTest.FailureToVerifyWithCorruptedTokens (#33978)
Disable upstream test AnonymousTokensRsaBssaClientWithPublicMetadataTest.FailureToVerifyWithCorruptedTokens

This is a Chromium third-party test (third_party/anonymous_tokens/) with
a 1.5% upstream flake rate (Chromium LUCI Analysis, 30-day lookback).
No Brave modifications affect this code path.

The test corrupts RSA blind signature tokens by setting byte 50 to 'a',
but since token bytes are random, there is a 1/256 chance per token that
byte 50 is already 'a', making the corruption a no-op. With 4 tokens,
the probability that at least one isn't actually corrupted is ~1.56%,
matching the observed upstream flake rate.

Resolves https://github.com/brave/brave-browser/issues/52852
2026-02-16 20:40:41 -05:00
Netzenbot 046db80cf1 Fix test: SplitViewLinkTest.SameDocumentNavigationDoesNotRedirect (#33916)
Replace RunLoop::Run() with RunUntil-based timeout in the
SameDocumentCommitObserver to prevent indefinite hangs when the
same-document navigation doesn't fire DidFinishNavigation on macOS
arm64 CI. The observer still uses event-driven detection via
DidFinishNavigation, but the wait mechanism now has a built-in
timeout instead of blocking forever.

Also add verification that the right pane URL doesn't change during
same-document navigation (no unintended redirect).

Fixes https://github.com/brave/brave-browser/issues/52808
2026-02-15 07:14:05 -05:00
Netzenbot 30f4502641 Disable Chromium test IsolatedWebAppRetryTest.FirstInstallFailsRetrySucceeds (#33909)
This is an upstream Chromium test with an 8.1% flake rate per LUCI
Analysis (30-day lookback). The test has intermittent timing failures
in IWA retry logic using MOCK_TIME + BackoffEntry - expected 1 install
task but got 2 due to retry firing earlier than expected.

No Brave modifications exist in the IWA policy area. Another test from
the same class (RetryTriggeredWhenAllTasksDone) is already filtered for
the same reason.

Resolves https://github.com/brave/brave-browser/issues/52780
2026-02-12 16:03:33 -05:00
Netzenbot d7a97d3cb6 Flush thread pool after TestingProfile storage partition shutdown (#33889)
When a TestingProfile is destroyed, ShutdownStoragePartitions() triggers
background database cleanup tasks (e.g., SharedDictionary SQLite store).
On Windows, these tasks may still hold file locks when a new profile is
created at the same path, causing FATAL crashes in sql::Statement when
two backends compete for the same database file.

Brave creates additional browser context keyed services that widen this
race window compared to upstream Chromium (where the test is 100% stable
with 0% flake rate across 204K+ runs).

Fix: Add FlushForTesting() after ShutdownStoragePartitions() in the
TestingProfile destructor to ensure all background thread pool tasks
complete before the profile directory is released.

Resolves brave/brave-browser#52777
2026-02-12 12:15:35 -05:00
Netzenbot d6fb877f0a Fix BraveImporterBrowserTest.ReImportExtensions DCHECK failure (#33876)
The LeveldbValueStore created by TestValueStoreFactory registers itself
as a memory dump provider. When a memory dump is triggered during the
NonBlockingDelay polling loop, it attempts to create a dump with name
"extensions/value_store/Extensions.Database.Open.Test/<ptr>" which is
not in the kAllocatorDumpNameAllowlist, causing a DCHECK failure.

Scope the store so it is destroyed (and unregistered) before the
polling loop runs.

Resolves brave/brave-browser#52739
2026-02-12 11:49:30 -05:00
Netzenbot 22d39dffd3 Fix intermittent test: P3AConstellationHelperTest.NebulaSample (#33881)
The test asserts that the number of Nebula points requests out of 100
iterations is <= 25. The actual probability of a request is ~14.975%
(kNebulaParticipationRate + (1-kNebulaParticipationRate)*kNebulaScramblingRate),
giving an expected count of ~15 with stddev ~3.57. The bound of 25
(~2.8σ above mean) has a ~0.25% chance of being exceeded, causing
intermittent failures.

Widen the upper bound from 25 to 35 (~5.6σ above mean), making false
failures statistically negligible while still verifying that Nebula
sampling is working correctly.

Resolves brave/brave-browser#52741
2026-02-12 07:37:23 -05:00
Netzenbot d78ed56672 Disable flaky upstream test ProfileTokenWebSigninInterceptorTest (#33883)
Disable flaky Chromium test ProfileTokenWebSigninInterceptorTest.InterceptionCreatesNewProfileIfAccepted

This is an upstream Chromium test with an observer list destruction order
issue: ManagedProfileCreator registers as a ProfileManagerObserver but
isn't destroyed before ProfileManager during test teardown, causing a
CHECK(observers_.empty()) failure. Chromium has already disabled this
test on Mac (crbug.com/385383226). 0.8% upstream flake rate per LUCI
Analysis. No Brave modifications in related code paths.

Resolves https://github.com/brave/brave-browser/issues/52742
2026-02-11 22:00:40 -05:00
Netzenbot ceb282697f Disable flaky Chromium test SharedStorageManagerErrorParamTest.InitFailure_DestroyAndRecreateDatabase (#33880)
Disable flaky Chromium test SharedStorageManagerErrorParamTest.InitFailure_DestroyAndRecreateDatabase/FileBacked

This is an upstream Chromium test with a known 0.7% flake rate
(crbug.com/40831552), already disabled on Android. The test has a
DCHECK failure in MockResultQueue::NextOperationResult due to a mock
result queue race condition. Brave has no modifications to the shared
storage manager code path.

Resolves https://github.com/brave/brave-browser/issues/52740
2026-02-11 21:41:25 -05:00
Netzenbot 6c75906d2a Disable flaky Chromium test IsolatedWebAppUpdateManagerUpdateTest (#33875)
Disable flaky Chromium test IsolatedWebAppUpdateManagerUpdateTest.SkipsUpdateDiscoveryTaskForNotAllowlistedIwa

This upstream Chromium test has an intermittent CHECK failure in
UpdateKeyDistributionInfo (test_utils.cc) due to a race condition in
async component loading. LoadKeyDistributionData posts tasks to a
thread pool and the TestFuture can receive a stale component
notification with mismatched version.

No Brave modifications exist in the isolated_web_apps or
key_distribution code areas. The test has a 0.7% upstream flake rate
over 30 days per LUCI Analysis.

Resolves https://github.com/brave/brave-browser/issues/52733
2026-02-11 20:18:58 -05:00
Netzenbot 4d074f7a47 Fix flaky BraveExtensionsManifestV2InstallerBrowserTest.InstallExtension (#33837)
The test was intermittently failing with SSL handshake errors and
"Failed to download extension." because the kHostResolverRules used
MAP *:443 which routed ALL HTTPS traffic to the test server. Other
browser subsystems (Safe Browsing, sync, etc.) would also connect to
the test server, causing spurious SSL handshake failures that could
interfere with the extension CRX download.

Narrow the host resolver rule to MAP a.test:443 so only the test
domain is routed to the HTTPS test server. Also move the
host_resolver()->AddRule() call to the beginning of SetUpOnMainThread()
to ensure DNS resolution is configured before the server starts
accepting connections.

Resolves https://github.com/brave/brave-browser/issues/52732
2026-02-10 17:25:09 -05:00