Closed Bug 1507283 Opened Last year Closed Last year

Review possible relaxed deserialization of payload data (not strict WebDriver conformant)


(Testing :: geckodriver, defect, P1)



(firefox-esr60 unaffected, firefox64 wontfix, firefox65 wontfix, firefox66 fixed)

Tracking Status
firefox-esr60 --- unaffected
firefox64 --- wontfix
firefox65 --- wontfix
firefox66 --- fixed


(Reporter: whimboo, Assigned: whimboo)



(Keywords: regression)


(2 files)

A couple of Github issues have been filed recently which are all about several commands not working because Serde refuses deserialization due to unknown keys in the payload data, which mostly did exist for backward compatibility.

An example here is:

I wonder if we should relax our deserialization a bit so that unknown keys are simply ignored, and don't cause a failure. As it looks like there are still a couple of clients around, which don't work when geckodriver operates in strict mode.

What do you think?
Flags: needinfo?(james)
Flags: needinfo?(dburns)
Flags: needinfo?(ato)
Note, that my Serde changes caused this change of behavior in geckodriver.
Blocks: 1396821
Keywords: regression
Yes, sorry I didn't catch this originally. The spec ignores unknown keys except in a very few cases (notably the fields for capabilities). We should certainly do the same (and write tests for it!).
Flags: needinfo?(james)
We should allow unknown keys to go through unless there is a very good reason not to
Flags: needinfo?(dburns)
Flags: needinfo?(ato)
I just commented on this in
before I saw this too, which gives the historical context similar
to what David and James said.
The specific problem in the linked bugs are to do with Set Timeouts,
which also necessitates a change in the specification as well as
I’ve filed
about relaxing the Marionette deserialisation too.
Depends on: 1507782

The problem with timeout parameters actually was that we denied unknown fields. Thankfully that flag for Serde was only set for this struct, so nothing else should actually be affected. I will add a couple more webdriver unittests.

Assignee: nobody → hskupin
Priority: -- → P1

It fixes the regression from the transition to Serde (bug 1396821),
which accidentally denied unknown fields.

This is not blocked by bug 1507782.

No longer depends on: 1507782
Pushed by
[geckodriver] Relax deserialization of timeouts parameters. r=ato

Backed out for /webdriver/tests/set_timeouts/ failures


push with failures:

failure log:

[task 2019-01-25T15:08:30.018Z] 15:08:30 INFO - TEST-PASS | /webdriver/tests/set_timeouts/ | test_parameters_empty_no_change
[task 2019-01-25T15:08:30.018Z] 15:08:30 INFO - TEST-PASS | /webdriver/tests/set_timeouts/ | test_script_parameter_empty_no_change
[task 2019-01-25T15:08:30.019Z] 15:08:30 INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/set_timeouts/ | test_key_invalid - assert 200 == 400
[task 2019-01-25T15:08:30.019Z] 15:08:30 INFO - session = <Session 6d57baf4-2d60-40d7-bc65-451cea91b5aa>
[task 2019-01-25T15:08:30.019Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.020Z] 15:08:30 INFO - def test_key_invalid(session):
[task 2019-01-25T15:08:30.020Z] 15:08:30 INFO - response = set_timeouts(session, {"foo": 1000})
[task 2019-01-25T15:08:30.020Z] 15:08:30 INFO - > assert_error(response, "invalid argument")
[task 2019-01-25T15:08:30.020Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.020Z] 15:08:30 INFO - response = <Responsetatus=200 body={"value": null}>
[task 2019-01-25T15:08:30.021Z] 15:08:30 INFO - session = <Session 6d57baf4-2d60-40d7-bc65-451cea91b5aa>
[task 2019-01-25T15:08:30.022Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.022Z] 15:08:30 INFO - tests/web-platform/tests/webdriver/tests/set_timeouts/
[task 2019-01-25T15:08:30.022Z] 15:08:30 INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[task 2019-01-25T15:08:30.022Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.022Z] 15:08:30 INFO - response = <Responsetatus=200 body={"value": null}>
[task 2019-01-25T15:08:30.023Z] 15:08:30 INFO - error_code = 'invalid argument'
[task 2019-01-25T15:08:30.023Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO - def assert_error(response, error_code):
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO - """
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO - Verify that the provided webdriver.Response instance described
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO - a valid error response as defined by dfn-send-an-error and
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO - the provided error code.
[task 2019-01-25T15:08:30.024Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.025Z] 15:08:30 INFO - :param response: webdriver.Response instance.
[task 2019-01-25T15:08:30.025Z] 15:08:30 INFO - :param error_code: String value of the expected error code
[task 2019-01-25T15:08:30.025Z] 15:08:30 INFO - """
[task 2019-01-25T15:08:30.025Z] 15:08:30 INFO - > assert response.status == errors[error_code]
[task 2019-01-25T15:08:30.026Z] 15:08:30 INFO - E assert 200 == 400
[task 2019-01-25T15:08:30.026Z] 15:08:30 INFO - E + where 200 = <Responsetatus=200 body={"value": null}>.status
[task 2019-01-25T15:08:30.026Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.026Z] 15:08:30 INFO - error_code = 'invalid argument'
[task 2019-01-25T15:08:30.027Z] 15:08:30 INFO - response = <Responsetatus=200 body={"value": null}>
[task 2019-01-25T15:08:30.027Z] 15:08:30 INFO -
[task 2019-01-25T15:08:30.027Z] 15:08:30 INFO - tests/web-platform/tests/webdriver/tests/support/ AssertionError
[task 2019-01-25T15:08:30.040Z] 15:08:30 INFO - ..................................
[task 2019-01-25T15:08:30.043Z] 15:08:30 INFO - TEST-OK | /webdriver/tests/set_timeouts/ | took 7860ms

Flags: needinfo?(hskupin)

This is a problem with an invalid test, which shouldn't have been added to the wdspec tests. Reason is that it uses an unknown key for the type of timeout, which should simply be ignored. And that is what this patch is actually doing.

As discussed with Andreas on IRC we will remove this specific test.

Flags: needinfo?(hskupin)
Pushed by
[geckodriver] Relax deserialization of timeouts parameters. r=ato
[wdspec] Remove invalid set timeout test "test_key_invalid". r=ato
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Created web-platform-tests PR for changes under testing/web-platform/tests
Duplicate of this bug: 1507782
You need to log in before you can comment on or make changes to this bug.