Closed Bug 1644913 Opened 5 years ago Closed 5 years ago

Intermittent devtools/server/tests/xpcshell/test_extension_storage_actor.js | xpcshell return code: 0

Categories

(Thunderbird :: General, defect, P5)

defect

Tracking

(thunderbird78 unaffected)

RESOLVED FIXED
Thunderbird 79.0
Tracking Status
thunderbird78 --- unaffected

People

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

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Cc'ing some devtools people. Could you have a look at this, please?

Apparently it happens on Mac too.

This is probably related to https://bugzilla.mozilla.org/show_bug.cgi?id=1583738 which changed the way we connect to Addon targets.

I don't remember exactly what happened with thunderbird when we removed the ability to debug legacy addons in mozilla central, but I remember talking about duplicating the old DevTools addon target actor and keep it only in TB's codebase ?
I can find an old webextension target actor at https://searchfox.org/comm-central/source/mozilla/devtools/server/actors/targets/webextension.js but I can't find the commit log for this file. And all the content of devtools/server/actors on comm-central searchfox is really old.

Geoff: Does the content on searchfox correspond to what is currently used by comm-central? Otherwise, how can I check which files of mozilla central are used?

Assuming we indeed have an old WebExtensionTargetActor in comm-central, it might just be about the last commit of Bug 1583738, where we started "attaching" by default to webextension targets, since the error in the logs is about a failure while calling "detach". On DevTools side, we catch detach errors, but it seems the test harness is still catching it and considering as a test failure.
But I need to understand comm-central's setup around devtools webextension targets better before working on a fix.

Flags: needinfo?(geoff)
Regressed by: 1583738

(In reply to Julian Descottes [:jdescottes] from comment #4)

I don't remember exactly what happened with thunderbird when we removed the ability to debug legacy addons in mozilla central, but I remember talking about duplicating the old DevTools addon target actor and keep it only in TB's codebase ?

Hmm, there shouldn't be any of that hanging around any more. All of our add-ons have been WebExtensions (technically at least) since 68.

I can find an old webextension target actor at https://searchfox.org/comm-central/source/mozilla/devtools/server/actors/targets/webextension.js but I can't find the commit log for this file. And all the content of devtools/server/actors on comm-central searchfox is really old.

Geoff: Does the content on searchfox correspond to what is currently used by comm-central? Otherwise, how can I check which files of mozilla central are used?

That's mozilla-central code (everything under https://searchfox.org/comm-central/source/mozilla is, and AFAIK it's usually up-to-date).

Flags: needinfo?(geoff)

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

Hmm, there shouldn't be any of that hanging around any more. All of our add-ons have been WebExtensions (technically at least) since 68.

Thanks, that's good to know.

That's mozilla-central code (everything under https://searchfox.org/comm-central/source/mozilla is, and AFAIK it's usually up-to-date).

Right sorry, I was confused between the webextensiondescriptor and the webextensiontarget. The code looks up to date.
With that I'm not exactly sure why this error pops up only on comm-central. I still suspect https://hg.mozilla.org/mozilla-central/rev/623d3cc37bb4 to be the root cause, since the error seems to arise when we detach the webextension target.

It seems like the failure also happens on central https://bugzilla.mozilla.org/show_bug.cgi?id=1618059

See Also: → 1618059

I think the addon failures are not directly responsible for the test failure actually. I got the same failures locally.
The error that seems to trigger the test failure is

TEST-UNEXPECTED-FAIL | devtools/server/tests/xpcshell/test_extension_storage_actor.js | test_panel_live_reload - [test_panel_live_reload : 265] A promise chain failed to handle a rejection: can't access property "update", this.storageActor is null - stack: onWindowReady@resource://devtools/server/actors/storage.js:281:9

Which means that in the following method:

    async onWindowReady(window) {
      const host = this.getHostName(window.location);
      if (host && !this.hostVsStores.has(host)) {
        await this.populateStoresForHost(host, window);
        const data = {};
        data[host] = this.getNamesForHost(host);
        this.storageActor.update("added", typeName, data);
      }
    },

the storage actor gets destroyed while we wait for this.populateStoresForHost(host, window);
Given how the method is written, it's definitely exposed to such race conditions.

The first failure on mozilla-central also happened slightly prior to both Bug 1620243 and Bug 1583738. https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=7f7b983390650cbc7d736e92fd3e1f629a30ac02&selectedTaskRun=AVrDWr5aTgqW6VjBMJhvDg-0

It might be linked to something else than these two bugs, which makes populateStoresForHost run slower than usual?

No longer regressed by: 1583738
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b91a23c94b9a Avoid exceptions if the storage actor is destroyed while processing a new window r=ochameau
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 79.0

Thank you Julian.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: