tst_ScriptMessageRouting_no_match.qml random test failure

Bug #1438412 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Triaged
Medium
Unassigned
webbrowser-app
Invalid
Medium
Unassigned
webbrowser-app (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

On trunk, I'm getting the following random test failure:

FAIL! : qml-core-test::ScriptMessageRouting_direct::test_ScriptMessageRouting_no_match(row 1) Unexpected error type
   Actual (): 5
   Expected (): 3
   Loc: [/home/chr1s/src/oxide/class-hierarchy-cleanliness/qt/tests/qmltests/core/tst_ScriptMessageRouting_no_match.qml(44)]

The test is checking the response of the browser-side message routing when there are no handlers available by sending a message to the frame and having it loop back to the browser. When the browser returns an error for the looped back message, the frame is then meant to reply to the original request by sending the error code (which we expect to be 3 - ErrorNoHandler). In this case though, we're getting a genuine error from the message transaction to the frame (5 - ErrorHandlerDidNotRespond).

The content-side handler for this test that loops back to the browser looks like this:

oxide.addMessageHandler("SEND-MESSAGE-TO-SELF", function(msg) {
  var r = oxide.sendMessage(msg.args.id, msg.args.args);
  r.onreply = function(response) {
    msg.reply({error: 0, response: response});
  };
  r.onerror = function(error, desc) {
    msg.reply({error: error, response: desc});
  };
});

What happens is that when the handler has executed, "r" goes out of scope and then sometimes gets garbage collected before we get a reply or error from the browser. When it gets garbage collected, we automatically send the "DidNotRespond" error to the message source in the browser.

I'm amazed we've only just started hitting this.

This is likely to be an issue for existing consumers of Oxide, and could affect the browser side too

Changed in oxide:
importance: Undecided → Critical
status: New → Triaged
milestone: none → branch-1.7
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in webbrowser-app:
status: New → Confirmed
importance: Undecided → Medium
Changed in oxide:
importance: Critical → High
Changed in oxide:
milestone: branch-1.7 → branch-1.8
Changed in oxide:
milestone: branch-1.8 → branch-1.9
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in webbrowser-app:
status: Confirmed → Invalid
Changed in oxide:
milestone: branch-1.9 → branch-1.10
Changed in oxide:
importance: High → Medium
Changed in oxide:
milestone: branch-1.10 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.