WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
279079
[WebDriver][GLIB] Cookies tests failing to store cookies
https://bugs.webkit.org/show_bug.cgi?id=279079
Summary
[WebDriver][GLIB] Cookies tests failing to store cookies
Lauro Moura
Reported
2024-09-03 11:31:12 PDT
A number of WebDriver cookies tests are failing due to what seems to be a failure to write cookies. Investigation on imported/w3c/webdriver/tests/classic/add_cookie/add.py: Test code: def test_add_session_cookie(session, url): new_cookie = { "name": "hello", "value": "world" } session.url = url("/common/blank.html") clear_all_cookies(session) result = add_cookie(session, new_cookie) assert_success(result) cookie = session.cookies("hello") Call stack for the failing case, from WebAutomationSession: - `WebAutomationSession::addSingleCookie(...)` - `APIHTTPCookieStore::setCookies(Vector<WebCore::Cookie>&&)` - `WebCookieManager::setCookie(Vector<Cookie>&)` - Iterates the cookies vector, calling: - `NetworkStorageSession::setCookie(Cookie)` in `NetworkStorageSessionSoup.cpp` The command setting the cookie returns success, but the actual call to `soup_cookie_jar_add_cookie(cookieStorage(), cookie.toSoupCookie());` in `NetworkStorageSession::setCookie(const Cookie& cookie)` doesn't emit the "changed" signal that would report the cookie was actually stored. Setting cookies through JS works, even with `--automation`, which forces `webkit_website_data_manager_new_ephemeral()`. But these cookies arrive in the `NetworkStorageSession` through WebProcess' `WebCookieJar::setCookies(document, url, cookieString)`, which will end up calling `soup_cookie_jar_add_cookie_full/with_first_party`.
Attachments
Add attachment
proposed patch, testcase, etc.
Lauro Moura
Comment 1
2024-09-04 22:17:25 PDT
Other tests affected: imported/selenium/py/test/selenium/webdriver/common/cookie_tests.py::test_add_cookie[wpewebkit] imported/selenium/py/test/selenium/webdriver/common/cookie_tests.py::test_get_all_cookies[wpewebkit] imported/selenium/py/test/selenium/webdriver/common/cookie_tests.py::test_should_not_delete_cookies_with_asimilar_name[wpewebkit] For these, look like they're also triggering an issue in the teardown, by issuing "delete session" after the failure, which in turn is triggering an infinite loop of failures in "delete cookies" calls: For example: selenium.webdriver.remote.remote_connection: [DEBUG] Finished Request selenium.webdriver.remote.remote_connection: [DEBUG] POST
http://localhost:49781/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/url
{'url': '
http://127.0.0.1:8001/simpleTest.html
'} urllib3.connectionpool: [DEBUG]
http://localhost:49781
"POST /session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/url HTTP/1.1" 200 14 selenium.webdriver.remote.remote_connection: [DEBUG] Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Server': 'WebKitWebDriver', 'Date': 'Thu, 05 Sep 2024 05:08:10 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache', 'Content-Length': '14'}) selenium.webdriver.remote.remote_connection: [DEBUG] Finished Request selenium.webdriver.remote.remote_connection: [DEBUG] POST
http://localhost:49781/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie
{'cookie': {'name': 'foo', 'value': 'bar', 'domain': '127.0.0.1', 'path': '/', 'secure': False}} urllib3.connectionpool: [DEBUG]
http://localhost:49781
"POST /session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie HTTP/1.1" 200 14 selenium.webdriver.remote.remote_connection: [DEBUG] Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Server': 'WebKitWebDriver', 'Date': 'Thu, 05 Sep 2024 05:08:11 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache', 'Content-Length': '14'}) selenium.webdriver.remote.remote_connection: [DEBUG] Finished Request selenium.webdriver.remote.remote_connection: [DEBUG] POST
http://localhost:49781/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/execute/sync
{'script': 'return document.cookie', 'args': []} urllib3.connectionpool: [DEBUG]
http://localhost:49781
"POST /session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/execute/sync HTTP/1.1" 200 12 selenium.webdriver.remote.remote_connection: [DEBUG] Remote response: status=200 | data={"value":""} | headers=HTTPHeaderDict({'Server': 'WebKitWebDriver', 'Date': 'Thu, 05 Sep 2024 05:08:11 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache', 'Content-Length': '12'}) selenium.webdriver.remote.remote_connection: [DEBUG] Finished Request FAILEDselenium.webdriver.remote.remote_connection: [DEBUG] DELETE
http://localhost:49781/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589
{} urllib3.connectionpool: [DEBUG]
http://localhost:49781
"DELETE /session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589 HTTP/1.1" 200 14 selenium.webdriver.remote.remote_connection: [DEBUG] Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Server': 'WebKitWebDriver', 'Date': 'Thu, 05 Sep 2024 05:08:11 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'no-cache', 'Content-Length': '14'}) selenium.webdriver.remote.remote_connection: [DEBUG] Finished Request selenium.webdriver.remote.remote_connection: [DEBUG] DELETE
http://localhost:49781/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie
{} urllib3.connectionpool: [DEBUG] Starting new HTTP connection (1): localhost:49781 urllib3.util.retry: [DEBUG] Incremented Retry for (url='/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie'): Retry(total=2, connect=None, read=None, redirect=None, status=None) urllib3.connectionpool: [WARNING] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7cd93854ca50>: Failed to establish a new connection: [Errno 111] Connection refused')': /session/3a9a4f07-df91 -40ba-9fa6-78e3ebbdc589/cookie urllib3.connectionpool: [DEBUG] Starting new HTTP connection (2): localhost:49781 urllib3.util.retry: [DEBUG] Incremented Retry for (url='/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie'): Retry(total=1, connect=None, read=None, redirect=None, status=None) urllib3.connectionpool: [WARNING] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7cd9385b1150>: Failed to establish a new connection: [Errno 111] Connection refused')': /session/3a9a4f07-df91 -40ba-9fa6-78e3ebbdc589/cookie urllib3.connectionpool: [DEBUG] Starting new HTTP connection (3): localhost:49781 urllib3.util.retry: [DEBUG] Incremented Retry for (url='/session/3a9a4f07-df91-40ba-9fa6-78e3ebbdc589/cookie'): Retry(total=0, connect=None, read=None, redirect=None, status=None) urllib3.connectionpool: [WARNING] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7cd9385b25d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /session/3a9a4f07-df91 -40ba-9fa6-78e3ebbdc589/cookie urllib3.connectionpool: [DEBUG] Starting new HTTP connection (4): localhost:49781
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug