Harden WebNN test teardown and fix context leak after ReportBadMessage [chromium/src : main]

1 view
Skip to first unread message

Emily Andrews (Gerrit)

unread,
May 22, 2026, 5:00:24 PM (2 days ago) May 22
to Mirko Bonadei, Jerome Jiang, Reilly Grant, AyeAye Python Dispatcher, Bernhart, Bryan, Rafael Cintron, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Hu, Ningxin, Jiewei Qian, net-r...@chromium.org, grt+...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, feature-me...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, jz...@chromium.org, fgal...@chromium.org, chrome-intelligence-te...@google.com, devtools...@chromium.org
Attention needed from Rafael Cintron and Reilly Grant

Emily Andrews added 4 comments

Patchset-level comments
File-level comment, Patchset 69 (Latest):
Emily Andrews . resolved

Alright, we had a few merge conflicts, but I think I have it now.

I also discovered an issue where the context was leaking if we got a bad message because the OnDisconnect method wasn't getting called, so that meant that the contexts being destroyed was never happening. I added a waiter to wait on the contexts being destroyed instead of using RunUntilIdle.

Commit Message
Line 15, Patchset 19:WebNNTestEnvironment tracks per-receiver disconnect handlers via
flat_map
Rafael Cintron . resolved

Please update the CL description to match the latest implementation.

Emily Andrews

Done

File services/webnn/webnn_test_environment.cc
Line 137, Patchset 17: context_provider_->SetDisconnectHandlerForTesting(
Rafael Cintron . resolved

Reading through the code for set_disconnect_handler, I believe there can only be one. If so, we should be able to just call `SetDisconnectHandlerForTesting` every time and dispense with the member boolean.

Emily Andrews

How about we move to the constructor

Line 146, Patchset 19: if (id.has_value()) {
pending_receiver_count_++;
}
Rafael Cintron . resolved

In test environments, will `BindWebNNContextProvider` ever fail in practice? If not, we should assert that `id.has_value` is true.

Emily Andrews

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Rafael Cintron
  • Reilly Grant
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9fd675afb7a92e8c8492fdebcc5307608548a62f
Gerrit-Change-Number: 7747395
Gerrit-PatchSet: 69
Gerrit-Owner: Emily Andrews <emi...@microsoft.com>
Gerrit-Reviewer: Emily Andrews <emi...@microsoft.com>
Gerrit-Reviewer: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: AyeAye Python Dispatcher <android-build-ayeay...@system.gserviceaccount.com>
Gerrit-CC: Bernhart, Bryan <bryan.b...@intel.com>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Attention: Reilly Grant <rei...@chromium.org>
Gerrit-Comment-Date: Fri, 22 May 2026 21:00:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Rafael Cintron <rafael....@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Reilly Grant (Gerrit)

unread,
May 22, 2026, 7:56:32 PM (2 days ago) May 22
to Emily Andrews, Reilly Grant, Mirko Bonadei, Jerome Jiang, AyeAye Python Dispatcher, Bernhart, Bryan, Rafael Cintron, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Hu, Ningxin, Jiewei Qian, net-r...@chromium.org, grt+...@chromium.org, cblume...@chromium.org, penghuan...@chromium.org, feature-me...@chromium.org, mar...@chromium.org, chrome-intell...@chromium.org, jz...@chromium.org, fgal...@chromium.org, chrome-intelligence-te...@google.com, devtools...@chromium.org
Attention needed from Emily Andrews and Rafael Cintron

Reilly Grant voted and added 1 comment

Votes added by Reilly Grant

Code-Review+1

1 comment

Patchset-level comments
Reilly Grant . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Emily Andrews
  • Rafael Cintron
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9fd675afb7a92e8c8492fdebcc5307608548a62f
Gerrit-Change-Number: 7747395
Gerrit-PatchSet: 69
Gerrit-Owner: Emily Andrews <emi...@microsoft.com>
Gerrit-Reviewer: Emily Andrews <emi...@microsoft.com>
Gerrit-Reviewer: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: AyeAye Python Dispatcher <android-build-ayeay...@system.gserviceaccount.com>
Gerrit-CC: Bernhart, Bryan <bryan.b...@intel.com>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Attention: Emily Andrews <emi...@microsoft.com>
Gerrit-Comment-Date: Fri, 22 May 2026 23:56:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages