Closed Bug 1334052 Opened 3 years ago Closed 3 years ago

Intermittent browser/base/content/test/referrer/browser_referrer_open_link_in_container_tab2.js | A promise chain failed to handle a rejection: - TypeError: content.document.getElementById(...) is null

Categories

(Firefox :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 54
Tracking Status
firefox52 --- fixed
firefox53 --- fixed
firefox54 --- fixed

People

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

References

Details

(Keywords: intermittent-failure, Whiteboard: [stockwell fixed:race])

Attachments

(1 file)

doing some retriggers to see if a root cause is easy to find (still waiting on some bc4/bc3 retriggers on older revisions):
https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&filter-searchStr=win%20vm%20debug%20browser-chrome%20e10s&tochange=f0f9f8d08df208e0fd93da92e5007c782647e4aa&fromchange=bb0de976a39eccbdd7ed817de4c1e9379f65c4a7&selectedJob=71929543

This is trending to be a top intermittent!  I do wonder if this is the same as bug 1275447..we just skipped that on e10s and that is where this is failing as well :(

When I see screenshots, I see a blank tab (although a few tabs are open), so no wonder there is no elementid found.

:gabor, what do you think we should do with this bug?  Is there any information you wish I could get for you to help out with this or make a decision easier?
Flags: needinfo?(gkrizsanits)
(In reply to Joel Maher ( :jmaher) from comment #2)
> doing some retriggers to see if a root cause is easy to find (still waiting
> on some bc4/bc3 retriggers on older revisions):
> https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&filter-
> searchStr=win%20vm%20debug%20browser-
> chrome%20e10s&tochange=f0f9f8d08df208e0fd93da92e5007c782647e4aa&fromchange=bb
> 0de976a39eccbdd7ed817de4c1e9379f65c4a7&selectedJob=71929543
> 
> This is trending to be a top intermittent!  I do wonder if this is the same
> as bug 1275447..we just skipped that on e10s and that is where this is
> failing as well :(

Yes, it looks like this is exactly the same issue.

> 
> When I see screenshots, I see a blank tab (although a few tabs are open), so
> no wonder there is no elementid found.
> 
> :gabor, what do you think we should do with this bug?  Is there any
> information you wish I could get for you to help out with this or make a
> decision easier?

I'm working on re-enabling the other two, I'm leaving needinfo on me to get back once
I know more. We could turn this one off as well but I'm afraid the problem is in one of
the utility functions in head.js so it might affect all the tests in this directory... 
I'll make this my top priority.
yeah, this only showed up as soon as we disabled browser_referrer_open_link_in_container_tab.js.  I wonder if the failure handling code resets the state properly so browser_referrer_open_link_in_container_tab2.js can run- now that browser_referrer_open_link_in_container_tab.js is disabled we end up in the original state.

One thing to note, browser_referrer_open_link_in_container_tab2.js is now the first test to run in the browser session (previously it was browser_referrer_open_link_in_container_tab.js), maybe we have a race condition on startup or some odd timing that gets us into this situation.

If it isn't that, then it is common code paths between both tests, as you mentioned head.js.

Thanks for looking into this!
Seems like the tab switching is racy in head.js, let's give it a try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=316919529f96126d4f2d79fc66d18aac230f69a0&selectedJob=72952469
Flags: needinfo?(gkrizsanits)
Much better, if it works on mc, I will re-enable the disabled tests as a followup.
Attachment #8831702 - Flags: review?(mrbkap)
See Also: → 1334028
Comment on attachment 8831702 [details] [diff] [review]
Fixing racy tab switching. v1

Review of attachment 8831702 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/test/referrer/head.js
@@ +206,5 @@
> +  let browser = gTestWindow.gBrowser;
> +  let newTab = browser.addTab(url, aParams);
> +  return new Promise(function(resolve) {
> +    BrowserTestUtils.switchTab(browser, newTab).then(() => {
> +      BrowserTestUtils.browserLoaded(browser.selectedBrowser).then(() => {

This could just become:

let browser = gTestWindow.gBrowser;
return BrowserTestUtils.openNewForegroundTab(browser, () => { browser.selectedTab = browser.addTab(url, aParams); });
Attachment #8831702 - Flags: review?(mrbkap) → review+
(In reply to Blake Kaplan (:mrbkap) from comment #11)
> This could just become:
> 
> let browser = gTestWindow.gBrowser;
> return BrowserTestUtils.openNewForegroundTab(browser, () => {
> browser.selectedTab = browser.addTab(url, aParams); });

Oh, that's a lot nicer, thanks :)
https://hg.mozilla.org/mozilla-central/rev/00760a347626
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Assignee: nobody → gkrizsanits
Duplicate of this bug: 1275447
Duplicate of this bug: 1334028
Whiteboard: [stockwell fixed]
Whiteboard: [stockwell fixed] → [stockwell fixed:race]
You need to log in before you can comment on or make changes to this bug.