Skip to content

BUG: SessionStorageCache_Chrome fails in CI because the client makes no json post #24

Description

@jwrosewell

What fails

SessionStorageCache_Chrome, in both its (True) and (False) rows,
fails the Examples workflow on ubuntu with:

Assert.IsTrue failed. 'condition' expression: 'CountJsonPosts() >= 1'.
the first page must call the json endpoint at least once

It fails on every pull request opened since 28 August 2026, and it blocks
pull request 21 and
pull request 22, neither of
which causes it.

What has been established

Neither open pull request caused it. Pull request 21 changes no
.mustache file, and it fails the identical two tests with the identical
assertion as pull request 22, which does. Both runs also carry the same
surrounding log lines.

The test arrived from the shared suite rather than from this
repository.
The Examples workflow last passed on 27 July 2026, run
30250692221. SessionStorageCacheTests was added to
51Degrees/selenium-api-tests
on 30 July in commit 4fd1f13 and hardened on 6 August in f296259,
6ca6fe7 and 1e3cdea. It carries TestCategory("Contract"), which is
the filter this repository runs, and
ci/run-integration-tests.ps1 clones the
suite with git clone --depth 1 and no ref, so it always takes the
default branch tip. The first Examples run after the July gap, on 28
August, went red without anything changing here.

The rust integration satisfies the contract when a real browser drives
it.
Running dd-web-getting-started-cloud from the pull request 22
branch against the live cloud on 30 August 2026, behind a copy of the
suite's proxy and driven by headless Chrome, produced exactly one
POST /51dpipeline/json and rendered a real device id. Running the
actual SessionStorageCache_Chrome test locally, with the suite at the
same commit CI clones (578ea63), passes the CountJsonPosts assertion
and stops later for an unrelated reason, which is
issue 23. That holds with
the paid key and with the free key, and with --headless and with
--headless=new.

It is not the headless mode. The runner image carries Google Chrome
151, and Chrome removed the old headless implementation in version 132,
so --headless on the runner already means the new mode. Both spellings
send byte-identical headers, being a HeadlessChrome user agent together
with sec-ch-ua client hints naming Google Chrome.

The remaining question

The client only posts when the served payload carries a JavaScript
property with a body to run. Measured against the running example:

headers sent JavaScript bodies returned
plain Chrome user agent 3
HeadlessChrome user agent, no client hints none
HeadlessChrome user agent, with client hints 3

So the payload a browser gets depends on whether the client hints reach
the cloud. On a workstation they do, which is why the post happens and
the test passes. What the same request returns from a GitHub runner is
not known, and that is the gap.

What is being done about it

Branch ci/diagnose-selenium-json-post adds a temporary block to
ci/run-integration-tests.ps1 that prints the Chrome and ChromeDriver
versions and, for each of the three header sets above, how many runnable
JavaScript bodies the cloud returns to that runner. It is branched from
main rather than from either pull request, so the run also shows
whether main alone fails.

Remove that block once it has answered the question. No resource key is
printed by it, because the key stays inside the example rather than in
the requests it makes.

Written with AI assistance under James Rosewell's direction and needs
human review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions