Closed Bug 1737304 Opened 2 months ago Closed 1 month ago

Remove osfile.jsm usage from browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js test

Categories

(Firefox :: Tabbed Browser, task, P3)

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: standard8, Assigned: onuohaoluebube05, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=js][good-next-bug])

Attachments

(1 file)

Using OS.File for file access is now obsolete and can be replaced by code using IOUtils. Working towards this, we want ore move all OS.* usage from browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js

The code in question can be found here.

There is background information here about how to migrate from OS.File to IOUtils. If you have questions, please ask.

OS.Path.join can be simply replaced by PathUtils.join.

To run the tests after you've built, you can run ./mach mochitest browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js. You should also check ESLint before commiting: ./mach eslint browser/base/content/test/performance/.

I'm happy to mentor this. Note this bug will be auto-assigned when the first patch is attached.

Blocks: 1737311
Assignee: nobody → onuohaoluebube05
Status: NEW → ASSIGNED

Hello,

I run this
./mach mochitest browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js

Got this error

Unexpected Results
------------------
browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js
  FAIL Timed out waiting oop-browser-crashed (false-positive) event -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1336
chrome://mochitests/content/browser/browser/base/content/test/tabcrashed/head.js:getEventPromise/</maybeTimeout<:172
  FAIL Uncaught exception -
  FAIL Uncaught exception - NotFoundError: Could not open the file at C:\mozilla-source\mozilla-unified\objdir-frontend\dist\bin\platform.ini
  FAIL Uncaught exception - NotFoundError: Could not open the file at C:\mozilla-source\mozilla-unified\objdir-frontend\dist\bin\platform.ini
Flags: needinfo?(standard8)

I dont know if it is safe to remove const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); since we are no longer using OS.File

I submitted a patch so you can view the changes i have made so far and guide me on the next step forward

Thanks.

(In reply to onuohaoluebube05 from comment #2)

I run this ./mach mochitest browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js

Got this error

It took me a while, but I realised this test is skipped if you are on a non-debug build. I tried it on a debug build, and I still got a timeout, so I've pushed it to our try server to check if it runs properly there (it'll take the results a little while to be returned): https://treeherder.mozilla.org/jobs?repo=try&revision=782de8e50bb0eafeb871cf6ab6bcdaa5ea93624f

(In reply to onuohaoluebube05 from comment #3)

I dont know if it is safe to remove const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm"); since we are no longer using OS.File

Yes it is safe to remove that as it is no longer used in that file.

Flags: needinfo?(standard8)

I re-did the try build, as it needed a full debug build, not just an artifact one: https://treeherder.mozilla.org/jobs?repo=try&revision=a58317a3099bfedf57e514930800ab1764feec22

So I think this is good now :)

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aa2d25adc64a
Removed osfile.jsm usage from browser/base/content/test/tabcrashed/browser_aboutRestartRequired_buildid.js test r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.