Open Bug 1634649 Opened 5 years ago Updated 4 years ago

browser_dbg-breakpoints-reloading.js fails intermittently unless an unused inline script is added in the test document

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

See https://bugzilla.mozilla.org/show_bug.cgi?id=1592839#c37 for more context.

We had to modify a test document in order to silence an intermittent, but it's not clear why this works.

Basically the test tries to set a breakpoint on a JS line in a HTML document, but this fails frequently (permanently on linux debug fission apparently) unless we add a new script below the line where we try to set the breakpoint.

Maybe the line is not considered as debuggable?

diff --git a/devtools/client/debugger/test/mochitest/examples/doc-scripts.html b/devtools/client/debugger/test/mochitest/examples/doc-scripts.html
--- a/devtools/client/debugger/test/mochitest/examples/doc-scripts.html
+++ b/devtools/client/debugger/test/mochitest/examples/doc-scripts.html
@@ -25,6 +25,7 @@
       // This is a second inline script element whose breakpoints won't be
       // known until after the script element has been added.
       var x = 3;
+      inline_script2 = function () { var x = 5; };
     </script>
   </body>
 </html>

I'll dig into this when I'm triaging bugs for reviewing our source-file handling.

My guess is:

  1. The HTML file loads
  2. The devtools opens
  3. The <script> has already run and been GCed

We currently have logic to handle this by re-fetching the HTML and re-parsing the scripts, but it could easily be that something is broken in there somewhere.

Flags: needinfo?(loganfsmyth)

It looks like the logic to re-parse scripts should be working for this HTML file, but the URL information we need to fetch and re-parse the file is cleared if a shrinking GC were to run, so I'd only expect the breakpoint failure behavior that causes the test failure if a shrinking GC happened after the page has loaded and before the devtools have opened for the page.

Does anyone know if that's something that is particularly likely? I don't have a sense for when shrinking GC may be triggered.

Flags: needinfo?(jdescottes)

I don't know either and the logs are not showing any sign of GC happening during the test (although I am not sure if they do show up usually)

Flags: needinfo?(jdescottes)

I'm not sure what more I can add for this right now.

Severity: -- → S3
Flags: needinfo?(loganfsmyth)
You need to log in before you can comment on or make changes to this bug.