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)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: christoroybiaga, Assigned: christoroybiaga, Mentored)
References
Details
Attachments
(2 files, 1 obsolete file)
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
The issue here comes from a function (test_file_creation_time) that it's declared but never used.
Assignee | ||
Comment 2•3 years ago
|
||
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 | ||
Comment 3•3 years ago
|
||
Depends on D142764
Updated•3 years ago
|
Comment 4•3 years ago
|
||
(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 :)
Assignee | ||
Comment 5•3 years ago
|
||
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D142765
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Backed out for causing xpcshell failures on test_localfile.js.
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
Comment 10•3 years ago
|
||
(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.
Comment 11•3 years ago
|
||
(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
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/84986029e277
https://hg.mozilla.org/mozilla-central/rev/fc92feaff6b9
Description
•