Marionette hangs when last opened tab gets closed

RESOLVED WORKSFORME

Status

defect
--
major
RESOLVED WORKSFORME
3 years ago
2 years ago

People

(Reporter: whimboo, Assigned: ato)

Tracking

(Blocks 1 bug)

Version 3
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Not sure what the expected behavior should be but I assume it should not be a hang of Marionette. By simply closing the last open tab, Marionette immediately hangs and runs into an IOError.

class Test(MarionetteTestCase):
    def test_close(self):
        self.marionette.close()

Andreas, what should be the exact behavior? I assume closing the window should be discarded and Marionette should continue as usual?
Flags: needinfo?(ato)
Assignee

Comment 1

3 years ago
The expected WebDriver behaviour is for the session to end when the last top-level browsing context is discarded.

Currently `marionette.close()` causes the GeckoDriver#tearDownSession to be called which would explain the hang, but it doesn’t communicate back to the client that the session has ended.  WebDriver says we should do this by returning the list of window handles from the Close Window command so that the client can check its length to determine whether the session ended.

Fortunately, you’re in luck, because I’ve been working on this over the last couple of days.  I expect to have a patch which fixes at least the server-side issue soon.  The way I imagine fixing it is to not have any commands in the _Marionette protocol_ (not WebDriver) implicitly cause the session or connection to end, but to make this an option in the proxy (geckodriver) or in the client (Python client).
Flags: needinfo?(ato)
Assignee

Updated

3 years ago
Assignee: nobody → ato
Status: NEW → ASSIGNED
Assignee

Updated

3 years ago
OS: Unspecified → All
Hardware: Unspecified → All
Assignee

Updated

3 years ago
Blocks: webdriver
Assignee

Comment 2

3 years ago
I have a patch that mostly works for this, but I believe we need to fix the window handle issue when a remoteness change occurs before it can pass all tests.  We need to start using permanentKey.
I cannot reproduce this issue anymore. It seems to work just fine.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.