Closed Bug 1777505 Opened 3 years ago Closed 3 years ago

Intermittent comm/mail/components/addrbook/test/browser/browser_display_card.js | Cards list should have focus (actual: cards) - false == true

Categories

(Thunderbird :: Address Book, defect, P5)

Tracking

(thunderbird_esr102 fixed, thunderbird103 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird103 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: henry-x)

References

(Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression)

Attachments

(1 file)

The log seems actually solid.
Cards list should have focus (actual: cards)
Could reproduce this locally with ./mach test --verify. (linux)
An ordinary ./mach test seems fine.

(In reply to Nicolai Kasper from comment #1)

The log seems actually solid.
Cards list should have focus (actual: cards)
Could reproduce this locally with ./mach test --verify. (linux)
An ordinary ./mach test seems fine.

Yeah, I didn't notice it locally either.

I actually test for .matches(":focus") rather than just comparing against document.activeElement (which is what the (actual: cards) message uses). The difference is that an element will only have :focus if the window also has focus. Looking at the screenshot it seems that there is still a dialog open, which has focus: https://firefoxci.taskcluster-artifacts.net/aGXVWI3ATx-ujGARxkXvbw/0/public/test_info/mozilla-test-fail-screenshot_wm0247ew.png

Maybe we're not waiting long enough for it to close.

Geoff, do you know what might be happening?

According to this line https://treeherder.mozilla.org/logviewer?job_id=383001559&repo=comm-central&lineNumber=5257 the dialog is closed. And this is after a await BrowserTestUtils.domWindowClosed https://searchfox.org/comm-central/rev/bbad2db99551a14a1a6062a7c6d6b1d9c094cbf7/mail/components/addrbook/test/browser/browser_display_card.js#590-594

But the screen shot taken here https://firefoxci.taskcluster-artifacts.net/aGXVWI3ATx-ujGARxkXvbw/0/public/test_info/mozilla-test-fail-screenshot_wm0247ew.png, which I assume is taken when the :focus is tested for, it is shows as still open.

Is there something else we should wait for for the focus to return to the main window? Or should I just change the test from

Assert.ok(cardsList.matches(":focus"));

to

Assert.equal(cardsList, abDocument.activeElement);
Flags: needinfo?(geoff)

You could try waiting for Services.focus.activeWindow to be equal to window. That might help.

Flags: needinfo?(geoff)
Summary: Intermittent comm/mail/components/addrbook/test/browser/browser_display_card.js | single tracking bug → Intermittent comm/mail/components/addrbook/test/browser/browser_display_card.js | Cards list should have focus (actual: cards) - false == true

(In reply to Geoff Lankow (:darktrojan) from comment #4)

You could try waiting for Services.focus.activeWindow to be equal to window. That might help.

Thank you. That is what I was looking for. Unfortunately I tried waiting for this, and I tried with abDocument.hasFocus(), but it was not enough.

I give up. I'll just test against activeElement.

Assignee: nobody → henry
Status: NEW → ASSIGNED

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/fc116ed0ac04
Test against activeElement rather than ":focus" in browser_display_card. r=#thunderbird-reviewers,freaktechnik

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

Comment on attachment 9284146 [details]
Bug 1777505 - Test against activeElement rather than ":focus" in browser_display_card. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): bug 1752013
User impact if declined: Needed on beta since the patch for bug 1752013 landed there https://bugzilla.mozilla.org/show_bug.cgi?id=1752013#c30 and will cause intermittent failures.
Testing completed (on c-c, etc.): No new intermittent failures on comm-central since landing.
Risk to taking this patch (and alternatives if risky): Low

Attachment #9284146 - Flags: approval-comm-beta?

Comment on attachment 9284146 [details]
Bug 1777505 - Test against activeElement rather than ":focus" in browser_display_card. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9284146 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9284146 [details]
Bug 1777505 - Test against activeElement rather than ":focus" in browser_display_card. r=#thunderbird-reviewers

[Triage Comment]
Test-only fix for regressing bug 1752013, uplifted to c-esr102.

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

Attachment

General

Created:
Updated:
Size: