Closed Bug 1375481 Opened 7 years ago Closed 7 years ago

Remove unnecessary histogram's clearing in test_TelemetrySend.jsm

Categories

(Toolkit :: Telemetry, enhancement, P4)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: katejimmelon, Assigned: nm.mozilla, Mentored)

Details

(Whiteboard: [lang=js] [good first bug])

Attachments

(1 file)

In the test_TelemetrySend.js(test_discardBigPings) there is unnecessary clering of two histograms after clearing them in the loop. 
http://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js?q=test_TelemetrySend.js&redirect_type=direct#329

Additionaly, in tho whole file histogram's clearing is not unified: sometimes they clear in the loop, sometimes not. (The same for other files: test_TelemetrySendOldPings.js, test_PingAPI.js)
Whiteboard: [lang=js] [good first bug]
I think for the purpose of this specific bug, removing the unnecessary `clear()`s is enough.
Mentor: alessio.placitelli
Priority: -- → P4
This will involve:
* removing the unnecessary lines
* running the test to confirm things are working properly: ./mach test toolkit/components/telemetry/tests/unit/test_TelemetrySend.jsm
Mentor: chutten
I would take this bug if it's ok. TO get ir right: it's just to remove the lines in test_TelemetrySend.js?

Another question regarding testing. Running the test with 

>./mach test toolkit/components/telemetry/tests/unit/test_TelemetrySend.js

results in an error:

> 0:00.18 LOG: MainThread WARNING MOZ_NODE_PATH environment variable not set. Tests requiring http/2 will fail.
> Error running mach:
> 
>    ['test', 'toolkit/components/telemetry/tests/unit/test_TelemetrySend.js']
> 
> The error occurred in code that was called by the mach command. This is either
> a bug in the called code itself or in the way that mach is calling it.
> 
> You should consider filing a bug for this issue.

. Applying the workaround

>./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetrySend.jsm

as it was suggested in bug 1375482 comment 3 seems to work. Is this ok here, too?
Flags: needinfo?(chutten)
Yup! That's just the test harness complaining that you don't have nodejs configured, which you shouldn't need for these tests.
Flags: needinfo?(chutten)
I've did the changes locally and could submit the patch (hopefully via MozReview using hg push review if all is set up right). Should I wait until the bug is assigned to me? If so, who would assign it to me?
Flags: needinfo?(chutten)
I assigned it ago, so go ahead!
Assignee: nobody → nm.mozilla
Flags: needinfo?(chutten)
Comment on attachment 8881302 [details]
Bug 1375481 - Removed unnecessary clearings of histograms

https://reviewboard.mozilla.org/r/152502/#review157918

This looks good, thanks!
Attachment #8881302 - Flags: review+
Pushed by georg.fritzsche@googlemail.com:
https://hg.mozilla.org/integration/autoland/rev/299496ea4cac
Removed unnecessary clearings of histograms r=gfritzsche
Thanks a lot for the review and pushing the path!
https://hg.mozilla.org/mozilla-central/rev/299496ea4cac
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: