Closed Bug 1945157 Opened 1 year ago Closed 1 year ago

Intermittent comm/mail/test/browser/folder-display/browser_mailTelemetry.js | Count of S/MIME encrypted mails read should be correct in run 1 - 1 == 2 -

Categories

(Thunderbird :: General, defect, P5)

Tracking

(thunderbird_esr128 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
thunderbird_esr128 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: john)

Details

(Keywords: intermittent-failure, intermittent-testcase)

Attachments

(2 files, 1 obsolete file)

Using real data since bug 1864205 which would have at least made some timing difference

While trying to understand the intermittent fail, it was observed that
the test is not testing what it should and that the implementation
to report telemetry data is broken.

This patch aims to fix the test and the implementation without changing
the intention of the original implementation.

  1. What is wrong with the implementation?

Logs (see [1]) from a test with more debug output shows, that we record
two records for the first encrypted S/MIME message, but none for the
second. The OpenPGP message is recorded as is_encrypted: false.

This is caused by the load process of encrypted messages, which
get reloaded multiple times when they are displayed. This clears the
read flag and the so far collected telemetry data. Any incoming data
after a reload which cleared the read flag is ignored.

  1. Why is the test still passing, if there is no telemetry for the
    second message and the OpenPGP message is marked as "not encrypted"?

The test is using a faulty filter to reduce the seen events to encrypted
messages only. The statement assumes that the glean entry for
is_encrypted is a boolean, but is in fact a string (either "true" or
"false"). The filter condition therefore returns true for
is_encrypted being set to "false".

  1. What does this patch do?

The telemetry data is no longer cleared on reload, but only if a
different message is loaded (idea from Geoff, see [2]). When data is
collected, we initiate a timer to process the collected data, but the
timer gets reset each time a new telemetry information comes in. This
will give us a single telemetry set per message with the required
information (security, is_encrypted and is_signed).

The intermittent is fixed by introducing a new CustomEvent, which
tells the test and other consumers, when telemetry data has been
processed.

[1] : https://phabricator.services.mozilla.com/D239902#8284314
[2] : https://phabricator.services.mozilla.com/D197795#7213166

Assignee: nobody → john
Status: NEW → ASSIGNED
Attachment #9468921 - Attachment description: Bug 1945157 - Attempt to fix intermittent fail in browser_mailTelemetry.js. r=kaie → WIP: Bug 1945157 - Attempt to fix intermittent fail in browser_mailTelemetry.js. r=kaie
Attachment #9468921 - Attachment description: WIP: Bug 1945157 - Attempt to fix intermittent fail in browser_mailTelemetry.js. r=kaie → Bug 1945157 - Attempt to fix intermittent fail in browser_mailTelemetry.js. r=kaie
Target Milestone: --- → 137 Branch

Pushed by john@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/2970431527d2
Attempt to fix intermittent fail in browser_mailTelemetry.js. r=kaie

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

I can try to create a backport patch for esr128.

Attached patch 1945157-esr128.patch (obsolete) — Splinter Review

This is a backport to esr128.

It applies all the logic changes. The only difference is, it keeps using the old Telemetry reporting (not glean).

Backport v2, now with liniting fixed...

Attachment #9469478 - Attachment is obsolete: true

Comment on attachment 9469482 [details] [diff] [review]
1945157-esr128-v2.patch

[Triage Comment]
Approved for esr128

Attachment #9469482 - Flags: approval-comm-esr128+

Comment on attachment 9469482 [details] [diff] [review]
1945157-esr128-v2.patch

[User impact if declined]
No user impact

[Is this code covered by automated tests?]
yes

[Has the fix been verified in Daily? (or Beta for an ESR uplift?)]
no, because it isn't a functional change.

[Needs manual test from QA?]
no

[List of other uplifts needed]
none

[Risk to taking this patch]
low

[Why is the change risky/not risky? (and alternatives if risky)]
The code doesn't change user functionality.
All it changes is how we record telemetry numbers.

[String changes made/needed]
none

Attachment #9469482 - Flags: approval-comm-esr128+ → approval-comm-esr128?

Comment on attachment 9469482 [details] [diff] [review]
1945157-esr128-v2.patch

[Triage Comment]
Approved for esr128

Attachment #9469482 - Flags: approval-comm-esr128? → approval-comm-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: