<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>315313</bug_id>
          
          <creation_ts>2026-05-21 12:31:16 -0700</creation_ts>
          <short_desc>Web Inspector: InspectorTest.completeTest() should optionally force teardown of the inspected WebPageProxy and WebPageInspectorController inside test boundaries</short_desc>
          <delta_ts>2026-05-21 12:31:22 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://github.com/WebKit/WebKit/pull/65376</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>314902</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blaze Burg">bburg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2213049</commentid>
    <comment_count>0</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2026-05-21 12:31:16 -0700</bug_when>
    <thetext>Follow-up from PR #65376 (webkit.org/b/314902) review by Qianlang Chen (the-chenergy):

&gt; This is another instance of an inspector test failing to catch leaked
&gt; objects and making a different test run in the same test bot fail
&gt; instead. Maybe we should file a bug to add a functionality to
&gt; InspectorTest.completeTest() or the async test suite to optionally
&gt; force the teardown of the inspected WebPageProxy and its
&gt; WebPageInspectorController within the inspector test&apos;s boundary, and
&gt; opt into that in our site isolation layout tests.

Problem: Inspector layout tests can leave WebPageProxy / WebPageInspectorController objects alive past the test boundary. Receiver registrations or other instrumentation state then leak into a subsequent unrelated test, which is the test that actually trips an assertion or fails. Diagnosing those failures requires tracing back through the test bot run history, which is expensive.

Proposal: extend InspectorTest.completeTest() (or the async test suite scaffolding) so a test can opt into forced teardown of the inspected WebPageProxy + its WebPageInspectorController at completion. Site isolation layout tests should opt in by default since they exercise the most surface area for instrumentation lifecycle bugs.

This would have caught webkit.org/b/314902 (and the prior b/314808 instance) within the offending test, rather than surfacing as a flake in unrelated SI tests like ApplePayButton.html.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2213050</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-21 12:31:22 -0700</bug_when>
    <thetext>&lt;rdar://problem/177644831&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>