Open Bug 1420372 Opened 2 years ago Updated 5 months ago

Marionette client has to check for a valid pid of Firefox as returned with the capabilities

Categories

(Testing :: Marionette, enhancement, P3)

57 Branch
enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: whimboo, Assigned: savannah_seeker, Mentored)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: pi-marionette-client, Whiteboard: [lang=py])

User Story

To get started with Marionette please read https://firefox-source-docs.mozilla.org/testing/marionette/marionette/NewContributors.html

Attachments

(1 file, 6 obsolete files)

Right now Marionette client launches Firefox, and tries to connect to the port 2828 by default. If another Firefox instance is already running on that port, the connection will not be done to the expected instance of Firefox.

To prevent this the client should check in start_session, if the pid as returned by the capabilities matches the known pid of the handled instance.

It means this check can only be done if Marionette itself handles the Firefox instance.

Changes should be done around this line:

https://dxr.mozilla.org/mozilla-central/rev/0bb0f14672fdda31c19aea1ed829e050d693b9af/testing/marionette/client/marionette_driver/marionette.py#1242
I would be interested in working on this bug.
Comment on attachment 8932058 [details]
Bug 1420372 - check that instance pid matches the pid in capabilities.

https://reviewboard.mozilla.org/r/203116/#review208850

::: testing/marionette/client/marionette_driver/marionette.py:1244
(Diff revision 1)
>          self.session_id = resp["sessionId"]
>          self.session = resp["capabilities"]
>          # fallback to processId can be removed in Firefox 55
>          self.process_id = self.session.get("moz:processID", self.session.get("processId"))
> +
> +        if self.instance.runner.process_handler.pid != self.process_id:

This code will fail, if there is no instance available. Try to run it by using the following steps:

1. Start a Firefox instance with --marionette
2. Run marionette without --binary but with --address localhost:2828

In step 2 you will see that this raises an exception.

Also you can create a new variable for the instance pid, and use it in those 2 situations. It will make the lines shorter (especially for the format call).

::: testing/marionette/client/marionette_driver/marionette.py:1246
(Diff revision 1)
>          # fallback to processId can be removed in Firefox 55
>          self.process_id = self.session.get("moz:processID", self.session.get("processId"))
> +
> +        if self.instance.runner.process_handler.pid != self.process_id:
> +            raise errors.MarionetteException("Instance PID '{0}' doesn't match "
> +                                             "the PID from capabilities {1}"

I think we have to improve the wording here, but lets get the patch working first, and a test added. Maybe we have to change something more.
Attachment #8932058 - Flags: review?(hskupin) → review-
Attached patch test.patch (obsolete) — Splinter Review
This is the current state of of now. It seems that there are some issues with an InvalidSessionId after patching. I don't know exactly what is the cause of this, but I feel like we are pretty close to finding something.

Here is the debug output:
``` 0:11.64 TEST_START: MainThread test_marionette.py TestMarionette.test_raise_for_pid_mismatch
1511957490543	Marionette	DEBUG	Closed connection 7
1511957490544	Marionette	DEBUG	Accepted connection 9 from 127.0.0.1:32942
1511957490545	Marionette	TRACE	9 -> [0,1,"newSession",{}]
1511957490548	Marionette	DEBUG	Register listener.js for window 2147483649
1511957490552	Marionette	TRACE	9 <- [1,1,null,{"sessionId":"17612f0a-3919-4f5f-9f2a-53f63824718a","capabilities":{}}]
1511957490553	Marionette	TRACE	9 -> [0,2,"setTimeouts",{"script":30000}]
1511957490553	Marionette	TRACE	9 <- [1,2,null,{}]
1511957490554	Marionette	TRACE	9 -> [0,3,"setTimeouts",{"pageLoad":300000}]
1511957490554	Marionette	TRACE	9 <- [1,3,null,{}]
1511957490555	Marionette	TRACE	9 -> [0,4,"setTimeouts",{"implicit":0}]
1511957490555	Marionette	TRACE	9 <- [1,4,null,{}]
1511957490557	Marionette	TRACE	9 -> [0,5,"executeScript",{"scriptTimeout":null,"newSandbox":true,"args":[],"filename":"testcases.py","script":"dump('TEST-START: test_marionette.py TestMarionette.test_raise_for_pid_mismatch\\n')","sandbox":"simpletest","line":316}]
TEST-START: test_marionette.py TestMarionette.test_raise_for_pid_mismatch
1511957490564	Marionette	TRACE	9 <- [1,5,null,{"value":null}]
1511957490567	Marionette	DEBUG	Closed connection 9
1511957490568	Marionette	DEBUG	Accepted connection 10 from 127.0.0.1:32944
 0:11.69 LOG: MainThread WARNING Failed to gather test failure debug: 
stacktrace:
	WebDriverError@chrome://marionette/content/error.js:172:5
	InvalidSessionIDError@chrome://marionette/content/error.js:327:5
	assert.that/<@chrome://marionette/content/assert.js:385:13
	assert.session@chrome://marionette/content/assert.js:50:3
	despatch@chrome://marionette/content/server.js:557:7
	async*execute@chrome://marionette/content/server.js:534:11
	async*onPacket/<@chrome://marionette/content/server.js:509:15
	async*onPacket@chrome://marionette/content/server.js:508:8
	_onJSONObjectReady/<@chrome://marionette/content/transport.js:500:9

 0:11.69 TEST_END: MainThread ERROR, expected PASS
Traceback (most recent call last):
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 156, in run
    testMethod()
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py", line 74, in test_raise_for_pid_mismatch
    self.marionette.start_session()
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/decorators.py", line 23, in _
    return func(*args, **kwargs)
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/marionette.py", line 1249, in start_session
    self.process_id))
MarionetteException: Instance PID '2232' doesn't match the PID from capabilities -1
1511957490589	Marionette	TRACE	10 -> [0,1,"getContext",{}]
1511957490590	Marionette	TRACE	10 <- [1,1,{"error":"invalid session id","message":"","stacktrace":"WebDriverError@chrome://marionette/content/error.js:172:5\nInvalidSessionIDError@chrome://marionette/content/error.js:327:5\nas ... ync*onPacket@chrome://marionette/content/server.js:508:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:500:9\n"},null]
1511957490591	Marionette	TRACE	10 -> [0,2,"executeScript",{"scriptTimeout":null,"newSandbox":true,"args":[],"filename":"testcases.py","script":"dump('TEST-END: test_marionette.py TestMarionette.test_raise_for_pid_mismatch\\n')","sandbox":"simpletest","line":328}]
1511957490591	Marionette	TRACE	10 <- [1,2,{"error":"invalid session id","message":"","stacktrace":"WebDriverError@chrome://marionette/content/error.js:172:5\nInvalidSessionIDError@chrome://marionette/content/error.js:327:5\nas ... ync*onPacket@chrome://marionette/content/server.js:508:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:500:9\n"},null]
1511957490593	Marionette	TRACE	10 -> [0,3,"deleteSession",{}]
1511957490594	Marionette	TRACE	10 <- [1,3,{"error":"invalid session id","message":"","stacktrace":"WebDriverError@chrome://marionette/content/error.js:172:5\nInvalidSessionIDError@chrome://marionette/content/error.js:327:5\nas ... ync*onPacket@chrome://marionette/content/server.js:508:8\n_onJSONObjectReady/<@chrome://marionette/content/transport.js:500:9\n"},null]
1511957490598	Marionette	DEBUG	Closed connection 10
Error running mach:

    ['marionette', 'test', 'testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py', '-vv', '--gecko-log', '-']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

InvalidSessionIdException: 
stacktrace:
	WebDriverError@chrome://marionette/content/error.js:172:5
	InvalidSessionIDError@chrome://marionette/content/error.js:327:5
	assert.that/<@chrome://marionette/content/assert.js:385:13
	assert.session@chrome://marionette/content/assert.js:50:3
	despatch@chrome://marionette/content/server.js:557:7
	async*execute@chrome://marionette/content/server.js:534:11
	async*onPacket/<@chrome://marionette/content/server.js:509:15
	async*onPacket@chrome://marionette/content/server.js:508:8
	_onJSONObjectReady/<@chrome://marionette/content/transport.js:500:9


  File "/home/owner/src/mozilla-unified/testing/marionette/mach_commands.py", line 125, in marionette_test
    return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
  File "/home/owner/src/mozilla-unified/testing/marionette/mach_commands.py", line 63, in run_marionette
    failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runtests.py", line 72, in run
    runner.run_tests(tests)
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runner/base.py", line 883, in run_tests
    self.run_test_sets()
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runner/base.py", line 1088, in run_test_sets
    self.run_test_set(self.tests)
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runner/base.py", line 1066, in run_test_set
    self.run_test(test['filepath'], test['expected'])
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runner/base.py", line 1036, in run_test
    results = runner.run(suite)
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/runner/base.py", line 236, in run
    result = super(MarionetteTextTestRunner, self).run(test)
  File "/home/owner/src/mozilla-unified/testing/mozbase/moztest/moztest/adapters/unit.py", line 218, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/unittest/case.py", line 393, in __call__
    return self.run(*args, **kwds)
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 197, in run
    self.cleanTest()
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 253, in cleanTest
    self._delete_session()
  File "/home/owner/src/mozilla-unified/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 260, in _delete_session
    self.marionette.delete_session()
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/marionette.py", line 1275, in delete_session
    self._send_message("deleteSession")
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/decorators.py", line 23, in _
    return func(*args, **kwargs)
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/marionette.py", line 740, in _send_message
    self._handle_error(err)
  File "/home/owner/src/mozilla-unified/testing/marionette/client/marionette_driver/marionette.py", line 764, in _handle_error
```
Flags: needinfo?(hskupin)
The problem here is that you are cutting of a branch of the tree from under your feet. What you need here is a fresh instance of Marionette. You cannot re-use `self.marionette`, which even has a session open at that time. So add the following:

> try:
>     m = Marionette(bin=self.marionette.bin, port=2829)
>     m.start_session()
> finally:
>     m.cleanup()

It picks up the same binary, and starts a new Firefox at port 2829 (2828 is used by self.marionette). Then I see exactly the correct exception raised.
Flags: needinfo?(hskupin)
Hi, is this issue already settled? If not, can I work on this? Thanks!
Nathaniel, do you have an update for us? Thanks.
Assignee: nobody → me
Status: NEW → ASSIGNED
Flags: needinfo?(me)
Hello, unfortunately I have not had any free time to dedicate to working on this issue of of right now. Feel free to take it. As per feature completeness reference test.patch (note that it will probably not merge in cleanly). The main thing that needs to be completed is test_raise_for_pid_mismatch for the test of the newly implemented check.
Flags: needinfo?(me)
Thank you for the update Nathaniel, and sad to hear that you are not having the time. galuhsahid please let me know if you want to take this bug and continue the work based on Nathaniel's patch. Thanks.
Hi! Thanks for the update. I'd like to take this bug. Since I'm pretty occupied today, I'll start working on this tomorrow as soon as I can.
Hi, I've pushed my commits for code review. I picked up where Nathaniel left off. Apologies for the double code reviews--it's my first time contributing so I was still figuring things out. Thanks!
(In reply to galuhsahid from comment #13)
> Hi, I've pushed my commits for code review. I picked up where Nathaniel left
> off. Apologies for the double code reviews--it's my first time contributing
> so I was still figuring things out. Thanks!

Sounds great. Regarding your issue you might want to have a look at https://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview/commits.html#mozreview-commits and https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/firefoxworkflow.html#changing-code-after-reviews.

I updated the assignee now that you pushed a patch.
Assignee: me → galuh.tunggadewi
Attachment #8932830 - Attachment is obsolete: true
Attachment #8932058 - Attachment is obsolete: true
Comment on attachment 8940513 [details]
Bug 1420372 - Implemented raise if instance PID doesn't match PID from capabilities and unit test;

https://reviewboard.mozilla.org/r/210740/#review217112

::: testing/marionette/client/marionette_driver/marionette.py:1246
(Diff revision 1)
>          resp = self._send_message("newSession", body)
>          self.session_id = resp["sessionId"]
>          self.session = resp["capabilities"]
>          # fallback to processId can be removed in Firefox 55
>          self.process_id = self.session.get("moz:processID", self.session.get("processId"))
> +        

Make sure that you do not add extra white-space characters to the code.

As best do not publish the patch from the command line but have a look at the changes of the draft in mozreview before publishing it there.

::: testing/marionette/client/marionette_driver/marionette.py:1248
(Diff revision 1)
>          self.session = resp["capabilities"]
>          # fallback to processId can be removed in Firefox 55
>          self.process_id = self.session.get("moz:processID", self.session.get("processId"))
> +        
> +        if self.instance is not None:
> +            self.handled_instance_process_id = self.instance.runner.process_handler.pid

Lets make the variable name shorter like `self.instance_pid`.
Attachment #8940513 - Flags: review-
Comment on attachment 8940514 [details]
Bug 1420372 - Removed extra white-space characters;

https://reviewboard.mozilla.org/r/210742/#review217116

Please combine this commit with the other one. The steps in how to do this can be found in the second link which I posted in my last comment. Thanks.
[Mass Change 2018-01-15] Moving bugs to backlog
Priority: -- → P3
Comment on attachment 8941810 [details]
Bug 1420372 - Changed variable name self.handled_instance_process_id to self.instance_pid;

https://reviewboard.mozilla.org/r/212054/#review218840

It would be great if you could pop into the #ateam channel on irc.mozilla.org so that we can solve your problem with adding additional commits to this patch. Basically you miss to use `--amend` for the commit messages, or could do a `hg histedit` to roll all into a single commit.

Removing review for now. Thanks.
Attachment #8941810 - Flags: review?(hskupin)
Comment on attachment 8940514 [details]
Bug 1420372 - Removed extra white-space characters;

https://reviewboard.mozilla.org/r/210742/#review218842
Attachment #8940514 - Flags: review?(hskupin)
galuhsahid, do you have an update for us regarding the patch?
Flags: needinfo?(galuh.tunggadewi)
Attachment #8940514 - Attachment is obsolete: true
Attachment #8941810 - Attachment is obsolete: true
Comment on attachment 8940513 [details]
Bug 1420372 - Implemented raise if instance PID doesn't match PID from capabilities and unit test;

https://reviewboard.mozilla.org/r/210740/#review227026


Code analysis found 1 defect in this patch:
 - 1 defect found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: testing/marionette/client/marionette_driver/marionette.py:1251
(Diff revision 3)
> +
> +        if self.instance is not None:
> +            self.instance_pid = self.instance.runner.process_handler.pid
> +
> +            if self.instance_pid != self.process_id:
> +                raise errors.MarionetteException("Instance PID '{0}' doesn't match the PID from capabilities {1}".format(self.instance_pid, self.process_id))

Error: Line too long (157 > 99 characters) [flake8: E501]
Do you have time to fix up the patch so it can be landed?
Hi, I don't have my laptop with me right now but I will fix it up later today
Flags: needinfo?(galuh.tunggadewi)
Comment on attachment 8940513 [details]
Bug 1420372 - Implemented raise if instance PID doesn't match PID from capabilities and unit test;

https://reviewboard.mozilla.org/r/210740/#review228142

::: commit-message-ece8a:11
(Diff revision 3)
> +
> +MozReview-Commit-ID: 3ejXyRnKsrx
> +***
> +Bug 1420372 - Changed variable name self.handled_instance_process_id to self.instance_pid;r=whimboo
> +
> +MozReview-Commit-ID: LTrJqVZzMgG

Please make sure to fixup the commit details. Everything below the first `***` should be removed.

Also we need a better commit message itself which describes the new feature as added, without specifying too much details. Using the bug summary should be a good start.

::: testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py:12
(Diff revision 3)
>  
>  from marionette_driver import errors
>  from marionette_driver.marionette import Marionette
>  from marionette_harness import MarionetteTestCase, run_if_manage_instance, skip_if_mobile
>  
> +from mock import Mock, patch

this is a global package and as such has to moved up as second block. See https://www.python.org/dev/peps/pep-0008/#imports

::: testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py:63
(Diff revision 3)
>  
>          self.assertEqual(current_socket_timeout,
>                           self.marionette.client.socket_timeout)
>          self.assertEqual(current_socket_timeout,
>                           self.marionette.client._sock.gettimeout())
> +    

Here are still extra white-space characters. Same for line 67. Those will cause failures for linting. Please check yourself by running `mach lint testing/marionette`.

::: testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py
(Diff revision 3)
> +
> +            marionette = Marionette(bin=self.marionette.bin, port=2829)
> +            self.assertRaises(errors.MarionetteException, marionette.start_session)
> +            marionette.cleanup()
>  
> -

Why did you remove this line? Between different classes there have to be 2 empty lines.
Attachment #8940513 - Flags: review?(hskupin) → review-
Hi guys, I apologize for the delay. I want to inform that something urgent has come up and I won't be able to work on this at least in the near future, so please feel free to reassign this to someone else. Thank you so much for the feedback and guidance!
Sorry to hear that galuhsahid, but it's understandable. I will open this bug up for another contributor. Thanks for your work so far.
Assignee: galuh.tunggadewi → nobody
Status: ASSIGNED → NEW
Hello,
Is this bug still open or has it been fixed? Can I work on it for my first bug?
Sure Franck, go ahead. Please also see the already attached patch on this bug which you can take as starting point for your work. Thanks!

Please also see the URL in the user story which will help you to get started with Marionette.
User Story: (updated)
Hello Henrik, 
Thanks I will get straight to it. I will let you know if I have any issues. Here is the bug I will prefer to work on.
Hello Henrik, I sorry could not respond earlier on the bug, I was ill. After reading the comment thread, I have a logic for how to resolve the bug. Here is it: check if `self.process_id != self.current_window_handle` then raise an exception with a descriptive message of the problem. Is `current_window_handle` the right way to get the pid of the handled instance?
Hi Franck. There is no problem with a delay. Good to have you back. 


In regards of this bug, did you had a look at the patch as I told you in my last comment? It's state is actually pretty good, and there won't be too much work left. So as best import it, and resolve my review comments. See comment 28 for that.
MozReview-Commit-ID: 2xF8U422qN8
***
Bug 1420372 - Removed extra white-space characters;r=whimboo

MozReview-Commit-ID: 3ejXyRnKsrx
***
Bug 1420372 - Changed variable name self.handled_instance_process_id to self.instance_pid;r=whimboo

MozReview-Commit-ID: LTrJqVZzMgG

Bug 1420372 - Remove unnecessary whitespaces, place mock in third party lib imports, broke error message into multilines;r?whimboo
With this fix,Marionette client now checks if the pid returned by capabilities matches the pid of the handled...

...instance.
If the pid does not match, an exception is raised. A unit test `test_raise_for_pid_mismatch` was added in
test_marionette.py to test this functionality.

MozReview-Commit-ID: 9GSNnxRJv5x
Hello Henrik, I just pushed a commit for review. Can you have a look at it? I will be waiting for your feedback.
Flags: needinfo?(hskupin)
Hm, I replied 2 days ago. Here my answer:
https://phabricator.services.mozilla.com/D4313#98703

I don't know why that never reached Bugzilla. Marc, can you please have a look?
Flags: needinfo?(hskupin) → needinfo?(mcote)
As discussed in #ateam on IRC, discussion related to patches should be held in Phabricator.  Anyone involved with a patch should be receiving emails from Phabricator, and the main dashboard shows the current state of such patches as well.  I suggest authors and reviewers keep it in a pinned tab, as many people do with BMO's "My Dashboard" page.
Flags: needinfo?(mcote)
Hello Henrik, I have made all the changes that you requested. I code is now passing the linting process without errors, but I have the following error when I run `./mach marionette test` for testing. Please can you have a look at it for me.

UnknownCommandException: newSession
stacktrace:
        WebDriverError@chrome://marionette/content/error.js:178:5
        UnknownCommandError@chrome://marionette/content/error.js:472:5
        despatch@chrome://marionette/content/server.js:290:13
        async*execute@chrome://marionette/content/server.js:271:11
        async*onPacket/<@chrome://marionette/content/server.js:246:15
        async*onPacket@chrome://marionette/content/server.js:245:8
        _onJSONObjectReady/<@chrome://marionette/content/transport.js:490:9


  File "c:\mozilla-source\mozilla-central\testing/marionette/mach_commands.py", line 127, in marionette_test
    return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/mach_commands.py", line 65, in run_marionette
    failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\runtests.py", line 72, in run
    runner.run_tests(tests)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\runner\base.py", line 858, in run_tests
    self.fixture_servers = self.start_fixture_servers()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\runner\base.py", line 959, in start_fixture_servers
    if self.appName == "fennec":
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\runner\base.py", line 677, in appName
    self._appName = self.capabilities.get('browserName')
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\runner\base.py", line 667, in capabilities
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 23, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1241, in start_session
    resp = self._send_message("newSession", body)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 23, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 743, in _send_message
    self._handle_error(err)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 767, in _handle_error
    raise errors.lookup(error)(message, stacktrace=stacktrace)
Vladimir, as it looks like your locally checked out code is kinda old and you should pull from central. The command (`newSession`) as used to create a new session was removed by bug 1451725 about a month ago. The marionette client code sends `WebDriver:NewSession` instead, see

https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/testing/marionette/client/marionette_driver/marionette.py#1252
Hello Henrik, I have pulled the latest version of mozilla-central and I have made the necessary changes based on your review. The code is now passing linting, but I still have some issues with passing all the test. Please can you help me with it. Here is a snapshot of the error I'm getting

marionette-test
~~~~~~~~~~~~~~~
Ran 918 checks (918 tests)
Expected results: 673
Skipped: 32 tests
Unexpected results: 213
  test: 213 (213 error)

Unexpected Results
------------------
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_marionette.py TestMarionette.test_client_for_valid_firefox_pid - MarionetteException: Instance PID 219592 doesn't match the PID from capabilities -1
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 159, in run
    testMethod()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_marionette.py", line 84, in test_client_for_valid_firefox_pid
    marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_in_app_restart - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 159, in run
    testMethod()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 171, in test_in_app_restart
    self.marionette.restart(in_app=True)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1179, in restart
    self.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_in_app_restart_with_callback - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_in_app_restart_with_callback_not_callable - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_keep_context_after_restart_by_set_context - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_keep_context_after_restart_by_using_context - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_no_in_app_clean_restart - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_reset_context_after_quit_by_set_context - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestQuitRestart.test_reset_context_after_quit_by_using_context - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py", line 81, in setUp
    MarionetteTestCase.setUp(self)
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestServerQuitApplication.test_attempt_quit - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestServerQuitApplication.test_empty_default - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Traceback (most recent call last):
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 140, in run
    self.setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 331, in setUp
    super(MarionetteTestCase, self).setUp()
  File "c:\mozilla-source\mozilla-central\testing/marionette/harness\marionette_harness\marionette_test\testcases.py", line 254, in setUp
    self.marionette.start_session()
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "c:\mozilla-source\mozilla-central\testing/marionette/client\marionette_driver\marionette.py", line 1264, in start_session
    self.instance.runner.process_handler.pid, self.process_id))
ERROR testing\marionette\harness\marionette_harness\tests\unit\test_quit_restart.py TestServerQuitApplication.test_force_quit - MarionetteException: Instance PID 37356 doesn't match the PID from capabilities 116288
Then I have another concern, I think we should not check if self.instance is None in the patch because start_session() already has a section that checks that. That snippet of code then calls `self.raise_for_port(timeout=timeout)` if self.instance is None.
Oh! I completely missed that we don't have an implementation for `process_handler.check_for_detached()` on Windows yet: 

https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/testing/marionette/client/marionette_driver/marionette.py#1183-1187

https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/testing/mozbase/mozprocess/mozprocess/processhandler.py#923

This is filed as bug 1438830 but I haven't had the time to get this fixed.

Vladimir, do you have Linux or MacOS too where you could test those changes? It would be great to have the patch ready and maybe exclude this check for Windows for the time being.

(In reply to vladimirfomene from comment #43)
> Then I have another concern, I think we should not check if self.instance is
> None in the patch because start_session() already has a section that checks
> that. That snippet of code then calls `self.raise_for_port(timeout=timeout)`
> if self.instance is None.

This is a different check, which has to be done before we send the `WebDriver:NewSession` command. It only makes sure that a socket connection is present. And then the response to that command, which includes the new process id, would need the same check because we can only do the process id check if Marionette itself handles the binary. Feel free to add a comment like for the first check in that method so it is clear.

Thanks.
Depends on: 1438830
Thank you for the clarification. I don't have linux installed. But I will get it install, make the necessary changes, commit and test the code.
Hello Henrik, I have finally gotten Linux on my laptop, I perform the changes and test it asap.
Bug 1420372 - Implement Marionette check for a vaid Firefox pid and unit tests. r=whimboo
Hello Henrik, I have finally finished setting up my environment on Linux. I have made all the previous changes, committed them and successfully pushed the revision to Phabricator. It is at https://phabricator.services.mozilla.com/D6478.
Depends on: 1493796
No longer depends on: 1438830
Hello Henrik, Apology for the delay on this work. I have made the changes you requested and have tested and linted. Please review and get back to me.
Hello Henrik,  I'm done with the changes you requested, but I did not change the line indenting because whenever I do, the code does not pass linting.
Here is the section of the log showing my test:

 0:34.02 TEST_START: testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py TestMarionette.test_client_for_valid_firefox_pid
 0:34.07 mozversion INFO application_buildid: 20180919124652
 0:34.07 mozversion INFO application_changeset: 3701bbe68f257a13322bb30f3898230ca2779e54
 0:34.07 mozversion INFO application_display_name: Nightly
 0:34.07 mozversion INFO application_id: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 0:34.07 mozversion INFO application_name: Firefox
 0:34.07 mozversion INFO application_remotingname: firefox
 0:34.07 mozversion INFO application_vendor: Mozilla
 0:34.07 mozversion INFO application_version: 64.0a1
 0:34.07 mozversion INFO platform_buildid: 20180919124652
 0:34.07 mozversion INFO platform_changeset: 3701bbe68f257a13322bb30f3898230ca2779e54
 0:34.07 mozversion INFO platform_version: 64.0a1
 0:34.07 INFO Application command: /home/fomene/src/mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -marionette -profile /tmp/tmprj2rTq.mozrunner
 0:38.41 TEST_END: PASS
 Here is the log for the valid pid test:
0:34.02 TEST_START: testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py TestMarionette.test_client_for_valid_firefox_pid
 0:34.07 mozversion INFO application_buildid: 20180919124652
 0:34.07 mozversion INFO application_changeset: 3701bbe68f257a13322bb30f3898230ca2779e54
 0:34.07 mozversion INFO application_display_name: Nightly
 0:34.07 mozversion INFO application_id: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 0:34.07 mozversion INFO application_name: Firefox
 0:34.07 mozversion INFO application_remotingname: firefox
 0:34.07 mozversion INFO application_vendor: Mozilla
 0:34.07 mozversion INFO application_version: 64.0a1
 0:34.07 mozversion INFO platform_buildid: 20180919124652
 0:34.07 mozversion INFO platform_changeset: 3701bbe68f257a13322bb30f3898230ca2779e54
 0:34.07 mozversion INFO platform_version: 64.0a1
 0:34.07 INFO Application command: /home/fomene/src/mozilla-central/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -marionette -profile /tmp/tmprj2rTq.mozrunner
 0:38.41 TEST_END: PASS
(In reply to vladimirfomene (:savannah_seeker) from comment #53)
>  Here is the log for the valid pid test:

Lets concentrate us on only this specific test. If the others are failing this might be due to other problems, which are not affecting the work you are doing here.

So what's still missing in the patch?

>  0:34.07 mozversion INFO application_buildid: 20180919124652

Btw, note that this is a pretty old build for a Nightly build of Firefox. You want to really pull from central and build Firefox again. There were some changes lately which improved the window manipulation tests, which seem to fail a lot for you.
Assignee: nobody → vladimirfomene
Status: NEW → ASSIGNED
Flags: needinfo?(vladimirfomene)
Hello Henrik,
I think the patch is complete. I have added the TODO for adding mock on transition to python 3 and the test is passing.
So I downloaded the latest changesets and build firefox again. I got fewer failed test. Thanks

marionette-test
~~~~~~~~~~~~~~~
Ran 937 checks (937 tests)
Expected results: 894
Skipped: 36 tests
Unexpected results: 7
  test: 7 (6 fail, 1 error)

Unexpected Results
------------------
ERROR testing/marionette/harness/marionette_harness/tests/unit/test_timeouts.py TestTimeouts.test_no_timeout_settimeout - ScriptTimeoutException: Timed out after 1000 ms
stacktrace:
	WebDriverError@chrome://marionette/content/error.js:178:5
	ScriptTimeoutError@chrome://marionette/content/error.js:418:5
	timeoutHandler@chrome://marionette/content/evaluate.js:100:35
	notify@resource://gre/modules/Timer.jsm:42:7
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_timeouts.py", line 100, in test_no_timeout_settimeout
    """))
  File "/home/fomene/src/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 1768, in execute_async_script
    rv = self._send_message("WebDriver:ExecuteAsyncScript", body, key="value")
  File "/home/fomene/src/mozilla-central/testing/marionette/client/marionette_driver/decorators.py", line 26, in _
    return func(*args, **kwargs)
  File "/home/fomene/src/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 759, in _send_message
    self._handle_error(err)
  File "/home/fomene/src/mozilla-central/testing/marionette/client/marionette_driver/marionette.py", line 779, in _handle_error
    raise errors.lookup(error)(message, stacktrace=stacktrace)
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py TestWindowRect.test_move_to_negative_coordinates - AssertionError: 67 not less than or equal to 0
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py", line 183, in test_move_to_negative_coordinates
    self.assertLessEqual(new_position["x"], 0)
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py TestWindowRect.test_resize_larger_than_screen - AssertionError: 711 not greater than or equal to 741
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py", line 206, in test_resize_larger_than_screen
    self.assertGreaterEqual(new_size["height"], self.max["height"])
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py TestWindowRect.test_resize_to_available_screen_size - AssertionError: 711 not greater than or equal to 741
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_rect.py", line 216, in test_resize_to_available_screen_size
    self.assertGreaterEqual(expected_size["height"], self.max["height"])
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py TestWindowMaximize.test_maximize - AssertionError: Window height is not within 22 px of availHeight: current height 713 should be greater than or equal to max height 719
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 65, in test_maximize
    self.assert_window_maximized(maximize_resp)
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 48, in assert_window_maximized
    .format(delta=delta, current=actual["height"], max=self.max["height"] - delta))
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py TestWindowMaximize.test_maximize_twice_is_idempotent - AssertionError: Window height is not within 22 px of availHeight: current height 713 should be greater than or equal to max height 719
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 69, in test_maximize_twice_is_idempotent
    self.assert_window_maximized(maximized)
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 48, in assert_window_maximized
    .format(delta=delta, current=actual["height"], max=self.max["height"] - delta))
FAIL testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py TestWindowMaximize.test_stress - AssertionError: Window height is not within 22 px of availHeight: current height 713 should be greater than or equal to max height 719
Traceback (most recent call last):
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/marionette_test/testcases.py", line 159, in run
    testMethod()
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 80, in test_stress
    self.assert_window_maximized(rect)
  File "/home/fomene/src/mozilla-central/testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py", line 48, in assert_window_maximized
    .format(delta=delta, current=actual["height"], max=self.max["height"] - delta))
Flags: needinfo?(vladimirfomene)
Attachment #8940513 - Attachment is obsolete: true
Attachment #9004149 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.