Closed Bug 1762749 Opened 2 years ago Closed 2 years ago

Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and xpcom/tests/unit/test_hidden_files.js

Categories

(Core :: XPCOM, defect)

Desktop
All
defect
Points:
3

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: christoroybiaga, Assigned: christoroybiaga, Mentored)

References

Details

Attachments

(2 files, 1 obsolete file)

No description provided.
Blocks: 1612907
Mentor: christoroybiaga
Points: --- → 3
OS: Unspecified → All
Hardware: Unspecified → Desktop
Mentor: christoroybiaga → standard8

The issue here comes from a function (test_file_creation_time) that it's declared but never used.

Flags: needinfo?(standard8)

I just added the function test_file_creation_time() to the run_test function and a run the tests to check if it works and it does.

Assignee: nobody → christoroybiaga
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

(In reply to Roy Christo from comment #2)

I just added the function test_file_creation_time() to the run_test function and a run the tests to check if it works and it does.

Yes, that's a great catch. One of the reasons I'm glad we're enabling ESLint :)

Flags: needinfo?(standard8)
Attachment #9270723 - Attachment description: Bug 1762749 - Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js. r?Standard8 → Bug 1762749 - Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and upgrade tests to the more current standard. r?Standard8
Attachment #9270731 - Attachment is obsolete: true
Attachment #9270723 - Attachment description: Bug 1762749 - Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and upgrade tests to the more current standard. r?Standard8 → Bug 1762749 - Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and upgrade tests to use add_task. r?Standard8
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3a3ece958323
Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and upgrade tests to use add_task. r=Standard8
https://hg.mozilla.org/integration/autoland/rev/798125b026fb
Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_hidden_files.js. r=Standard8
Regressions: 1763473

Backed out for causing xpcshell failures on test_localfile.js.

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception%2Cusercancel&fromchange=798125b026fb58ee3fd163cca344f619c8f5ffbc&tochange=ba79fe47f98c9df48b4d5ae860b8c724366802de&searchStr=xpc&test_paths=xpcom%2Ftests%2Funit&selectedTaskRun=LPw7H2tmRGuVBQYH9jTKRQ.0

Failure log: https://treeherder.mozilla.org/logviewer?job_id=373644051&repo=autoland

Backout link: https://hg.mozilla.org/integration/autoland/rev/ba79fe47f98c9df48b4d5ae860b8c724366802de

[task 2022-04-06T20:44:39.353Z] 20:44:39     INFO -  TEST-PASS | xpcom/tests/unit/test_localfile.js | test_file_creation_time - [test_file_creation_time : 161] true == true
[task 2022-04-06T20:44:39.354Z] 20:44:39  WARNING -  TEST-UNEXPECTED-FAIL | xpcom/tests/unit/test_localfile.js | test_file_creation_time - [test_file_creation_time : 175] false == true
[task 2022-04-06T20:44:39.354Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/tests/xpcom/tests/unit/test_localfile.js:test_file_creation_time:175
[task 2022-04-06T20:44:39.354Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_run_next_test/<:1772
[task 2022-04-06T20:44:39.355Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_run_next_test:1772
[task 2022-04-06T20:44:39.355Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:run:818
[task 2022-04-06T20:44:39.355Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_do_main:240
[task 2022-04-06T20:44:39.355Z] 20:44:39     INFO -  /builds/worker/workspace/build/tests/xpcshell/head.js:_execute_test:603
[task 2022-04-06T20:44:39.355Z] 20:44:39     INFO -  -e:null:1
[task 2022-04-06T20:44:39.356Z] 20:44:39     INFO -  exiting test
[task 2022-04-06T20:44:39.356Z] 20:44:39     INFO -  (xpcshell/head.js) | test run_next_test 6 finished (2)
[task 2022-04-06T20:44:39.356Z] 20:44:39     INFO -  Unexpected exception NS_ERROR_ABORT:
[task 2022-04-06T20:44:39.356Z] 20:44:39     INFO -  _abort_failed_test@/builds/worker/workspace/build/tests/xpcshell/head.js:874:20
[task 2022-04-06T20:44:39.357Z] 20:44:39     INFO -  do_report_result@/builds/worker/workspace/build/tests/xpcshell/head.js:975:5
[task 2022-04-06T20:44:39.357Z] 20:44:39     INFO -  Assert<@/builds/worker/workspace/build/tests/xpcshell/head.js:75:21
[task 2022-04-06T20:44:39.357Z] 20:44:39     INFO -  proto.report@resource://testing-common/Assert.jsm:228:10
[task 2022-04-06T20:44:39.357Z] 20:44:39     INFO -  proto.ok@resource://testing-common/Assert.jsm:254:10
[task 2022-04-06T20:44:39.358Z] 20:44:39     INFO -  test_file_creation_time@/builds/worker/workspace/build/tests/xpcshell/tests/xpcom/tests/unit/test_localfile.js:175:10
[task 2022-04-06T20:44:39.358Z] 20:44:39     INFO -  _run_next_test/<@/builds/worker/workspace/build/tests/xpcshell/head.js:1772:22
[task 2022-04-06T20:44:39.358Z] 20:44:39     INFO -  _run_next_test@/builds/worker/workspace/build/tests/xpcshell/head.js:1772:38
[task 2022-04-06T20:44:39.362Z] 20:44:39     INFO -  run@/builds/worker/workspace/build/tests/xpcshell/head.js:818:9
[task 2022-04-06T20:44:39.363Z] 20:44:39     INFO -  _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:240:6
[task 2022-04-06T20:44:39.363Z] 20:44:39     INFO -  _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:603:5
[task 2022-04-06T20:44:39.363Z] 20:44:39     INFO -  @-e:1:1
[task 2022-04-06T20:44:39.363Z] 20:44:39     INFO -  exiting test
[task 2022-04-06T20:44:39.364Z] 20:44:39     INFO -  <<<<<<<
[task 2022-04-06T20:44:39.364Z] 20:44:39     INFO -  INFO | Result summary:
[task 2022-04-06T20:44:39.364Z] 20:44:39     INFO -  INFO | Passed: 1062
[task 2022-04-06T20:44:39.364Z] 20:44:39  WARNING -  INFO | Failed: 1
[task 2022-04-06T20:44:39.365Z] 20:44:39  WARNING -  One or more unittests failed.
[task 2022-04-06T20:44:39.365Z] 20:44:39     INFO -  INFO | Todo: 0
[task 2022-04-06T20:44:39.365Z] 20:44:39     INFO -  INFO | Retried: 1
[task 2022-04-06T20:44:39.365Z] 20:44:39     INFO -  SUITE-END | took 368s
[task 2022-04-06T20:44:39.366Z] 20:44:39     INFO -  Node moz-http2 server shutting down ...
[task 2022-04-06T20:44:39.368Z] 20:44:39     INFO -  http3Server server shutting down ...
[task 2022-04-06T20:44:39.509Z] 20:44:39    ERROR - Return code: 1
Flags: needinfo?(christoroybiaga)
Backout by nfay@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/6ff2b7d52aa3
Backed out 2 changesets for causing xpcshell failures on test_localfile.js. CLOSED TREE

(In reply to Cosmin Sabou [:CosminS] from comment #8)

Backed out for causing xpcshell failures on test_localfile.js.

So the backout here was caused by this failure:

[task 2022-04-06T20:44:39.354Z] 20:44:39  WARNING -  TEST-UNEXPECTED-FAIL | xpcom/tests/unit/test_localfile.js | test_file_creation_time - [test_file_creation_time : 175] false == true

This only shows up on Linux and Windows, Mac is green: https://treeherder.mozilla.org/jobs?repo=autoland&selectedTaskRun=AwDGqJgSSsStMkJcFz_TzA.0&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception%2Crunnable&searchStr=xpc&test_paths=xpcom%2Ftests%2Funit&tochange=4c6880e760472e2effef3a1ddc4ffddf2c1a064f&fromchange=88cc45d69235ef56bbd5a3f6cac4b09ec083b25f

(the other failures, aka oranges, on Mac there are intermittent failures in other tests).

That failure came from this line.

Looking at the history of that file, this part of the test was added in bug 1660841, but obviously was never run, as the patch here shows.

I think what we should do is to skip this part of the test on Windows and Linux (thankfully add_task lets us do that), and let it run on Mac. We can then file a bug as follow-up for someone to investigate the failures on the other platforms.

I'll comment in the phabricator patch about how to skip that part of the test.

Flags: needinfo?(christoroybiaga)
Blocks: 1742928

(In reply to Mark Banner (:standard8) from comment #10)

I think what we should do is to skip this part of the test on Windows and Linux (thankfully add_task lets us do that), and let it run on Mac. We can then file a bug as follow-up for someone to investigate the failures on the other platforms.

It turns out the follow-up bug is already filed - bug 1742928

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84986029e277
Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_localfile.js and upgrade tests to use add_task. r=Standard8
https://hg.mozilla.org/integration/autoland/rev/fc92feaff6b9
Fix ESLint rule warnings for no-unused-vars in xpcom/tests/unit/test_hidden_files.js. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: