Closed Bug 1988681 Opened 2 months ago Closed 2 months ago

[wdspec] avoid race conditions with requests blocked in responseStarted phase

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task
Points:
2

Tracking

(firefox145 fixed)

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Regressed 1 open bug)

Details

(Whiteboard: [webdriver:m17])

Attachments

(1 file)

This bug relates to Bug 1966494 where we described how a request suspended in the responseStarted phase can still populate the cache and then be used for a second request.

The typical scenario where this is problematic in webdriver is:

  • add an intercept for responseStarted
  • send request to someurl
  • (request is blocked, as expected)
  • remove the intercept
  • send another request to someurl

Here we expect the request to go through, but sometimes it will be blocked as well because we end up reusing the the cached (suspended) response from the first request. We thought this was only the case when race-cache-with-network was disabled, but it seems that on Android 14, this happens intermittently in any case.

The long term solution here is described by bug 1966494, consists in adding a new API to remove entries from the cache, which we would call when a request has no intercept anymore. For now we should at least fix the intermittent.

One option we discussed is to use unique URLs per test to avoid situations where test1 blocks a request and test2 emits a new request which gets suspended. One of the test actually exercises something close to the STRs above, so here we will need to switch to a non-string pattern and generate distinct URLs.

Here is a list of impacted tests:

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

FWIW, Valentin confirmed that we could hit the cache due if Android 14 has faster I/O in Bug 1838145, so the analysis is probably correct and we should move on with the proposed patch here.

Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/87be5d0c187e https://hg.mozilla.org/integration/autoland/rev/684c63950d7b [wdspec] avoid race conditions with requests blocked in responseStarted phase r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54901 for changes under testing/web-platform/tests
Regressions: 1989203
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
Upstream PR merged by moz-wptsync-bot
Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:m17]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: