This test times out waiting for the server to return a Count header with a value of 2. It's stuck sending back 1. Could be a bug in the python that acts as a server and not necessarily in WebKit itself. All browsers fail this test (and all stale-while-revalidate tests) on WPT.
<rdar://problem/102734100>
Fix for this is pretty simple. The Python server only increments the count when there isn't a `query` parameter in the request. The initial fetch to get the image incremented the counter to 1 but in the test's "wait for revalidate" loop we always called fetch with the `query` URL parameter. This caused the server to never increment count. I added a boolean which we flip every other loop. This boolean determines whether or not we add `query` to the URL and in turn whether or not the server will increment the count.
Pull request: https://github.com/WebKit/WebKit/pull/6893
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/37213
Committed 257154@main (ee768c0b2c58): <https://commits.webkit.org/257154@main> Reviewed commits have been landed. Closing PR #6893 and removing active labels.