Skip to content

Wait for the shared store read in the shared choice test - #29

Draft
jwrosewell wants to merge 1 commit into
rcfrom
fix/shared-choice-wait-for-read
Draft

jwrosewell wants to merge 1 commit into
rcfrom
fix/shared-choice-wait-for-read

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The problem

SharedChoice_SecondSite_NoDialogAndDirectFlag_Firefox in Browser51Did/PmpAcceptanceTests.cs failed when the suite ran against a cloud reached over the internet by HTTPS, rather than a container on the same machine. The message was:

Assert.IsNotNull failed. 'value' expression: 'read'. PMP must ask the shared store what this visitor already chose. It made no such call. The requests were: fetch POST https://cloud.51degrees.com/api/v4/json status=200 done=True ...
  || fetch GET https://cloud.51degrees.com/api/v4/pmp/pref?network=Fifty%20One%20Network&resource=<resource key> status=0 done=False body=
  || fetch GET https://cloud.51degrees.com/api/v4/3pc status=0 done=False body=

PMP did make the read. The GET /api/v4/pmp/pref request was still in flight (done=False) when the test looked for it. After visitor.WaitForClientRounds(1) the test took the first finished GET at once (lines 233 and 234 on rc), without waiting for that request. Against a local container the read finishes almost immediately, so the gap never showed. The same test in Chrome passed in the same run, and the Firefox test failed the same way against two separate hosts.

The change

The test now waits for the read with Harness.Until, as it already does for the shared write at lines 177 and 223, and asserts on the finished request. The Assert.IsNotNull goes, because the wait fails with the same request list when no read finishes within the harness's 30 seconds of patience. The assertions on what the read answers, that the dialog stays closed and that the answer reaches the client script, are unchanged.

How it was checked

  • The suite's own checks on this pull request pass, which builds the change.
  • Against two remote hosts over HTTPS, this commit (702519f) ran both shared choice tests three times on each host, Chrome and Firefox. All 12 runs passed, Firefox in 5 to 24 seconds and Chrome in 8 to 29 seconds, the longest being each host's first run.
  • Before the change, the Firefox test failed on both hosts as described above, and the Chrome test passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant