Closed Bug 1737301 Opened 3 years ago Closed 3 years ago

Remove osfile.jsm usage from browser/base/content/test/performance/ tests

Categories

(Firefox :: General, task, P3)

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: standard8, Assigned: onuohaoluebube05, Mentored)

References

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/performance/

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/performance/. 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: 1737306
Blocks: 1737311

Hello,

After making the necessary changes for this bug, i run the test ./mach mochitest browser/base/content/test/performance/ and this was part of the output

Browser Chrome Test Summary
        Passed: 135
        Failed: 2
        Todo: 7
        Mode: e10s
*** End BrowserChrome Test Results ***
 4:25.75 INFO Buffered messages finished
 4:25.75 SUITE_END
 4:25.75
Overall Summary
===============

mochitest-browser
~~~~~~~~~~~~~~~~~
Ran 169 checks (144 subtests, 25 tests)
Expected results: 161
Skipped: 6 tests
Unexpected results: 2
  subtest: 2 (2 fail)

Unexpected Results
------------------
browser/base/content/test/performance/browser_startup_content_mainthreadio.js
  FAIL This test requires a packaged build, run 'mach package' and then use --appname=dist -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1336
chrome://mochitests/content/browser/browser/base/content/test/performance/browser_startup_content_mainthreadio.js:null:253
chrome://mochikit/content/browser-test.js:Tester_execTest/<:1091
chrome://mochikit/content/browser-test.js:Tester_execTest:1131
chrome://mochikit/content/browser-test.js:nextTest/<:939
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1041
browser/base/content/test/performance/browser_startup_mainthreadio.js
  FAIL This test requires a packaged build, run 'mach package' and then use --appname=dist -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1336
chrome://mochitests/content/browser/browser/base/content/test/performance/browser_startup_mainthreadio.js:null:657
chrome://mochikit/content/browser-test.js:Tester_execTest/<:1091
chrome://mochikit/content/browser-test.js:Tester_execTest:1131
chrome://mochikit/content/browser-test.js:nextTest/<:939
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1041





`
Flags: needinfo?(standard8)

I run ./mach package
then
./mach mochitest --appname=dist browser/base/content/test/performance/browser_startup_content_mainthreadio.js

And it was successful

Don't know if it cut it for the test.

Thanks

If that second sequence was successful, then that's fine :)

Flags: needinfo?(standard8)
Assignee: nobody → onuohaoluebube05
Status: NEW → ASSIGNED

Hello,

I did this await IOUtils.writeJSON(profilePath, startupRecorder.data.profile); and run ./mach eslint browser/base/content/test/performance/

And got this error message

c:/mozilla-source/mozilla-unified/browser/base/content/test/performance/browser_startup_content_mainthreadio.js
  443:9  error  'encoder' is assigned a value but never used.  no-unused-vars (eslint)

c:/mozilla-source/mozilla-unified/browser/base/content/test/performance/browser_startup_mainthreadio.js
  887:9  error  'encoder' is assigned a value but never used.  no-unused-vars (eslint)

c:/mozilla-source/mozilla-unified/browser/base/content/test/performance/browser_startup_syncIPC.js
  407:9  error  'encoder' is assigned a value but never used.  no-unused-vars (eslint)

✖ 3 problems (3 errors, 0 warnings, 0 fixed)
Flags: needinfo?(standard8)

What should i do?

let encoder = new TextEncoder();

Since you've removed the use of encoder then you can remove the let encoder = new TextEncoder(); line - it isn't needed any more.

Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ef346aadf589
Replaced OS.File with IOUtils in browser/base/content/test/performance/ r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
No longer blocks: 1737306
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: