Skip to content

Fix flaky ETag validation in event log acceptance tests - #5766

Merged
johnsimons merged 2 commits into
masterfrom
john/eventlog_etag_test_flake
Aug 14, 2026
Merged

Fix flaky ETag validation in event log acceptance tests#5766
johnsimons merged 2 commits into
masterfrom
john/eventlog_etag_test_flake

Conversation

@johnsimons

Copy link
Copy Markdown
Member

The test could fail if new events were written to the log between the initial request and the conditional poll, resulting in a 200 OK instead of a 304 Not Modified. The validation now accounts for this by checking if the ETag has changed when a 200 OK is received.

@johnsimons johnsimons self-assigned this Aug 13, 2026
// The endpoint keeps writing startup events, so a 200 here means either the
// validator went stale between the two requests, or the server ignored
// If-None-Match. Only the second is a failure, and the ETag tells them apart.
if (current.StatusCode == HttpStatusCode.OK && ReadEtag(current) != currentEtag)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the 200 with a new e-tag make the test inconclusive?
Shouldn't the Poll() be retrying with the new e-tag until the server goes quiet enough to get a conclusive pass or fail?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

The test could fail if new events were written to the log between the initial request and the conditional poll, resulting in a 200 OK instead of a 304 Not Modified. The validation now accounts for this by checking if the ETag has changed when a 200 OK is received.
The test could fail if new events were written to the log between the initial request and the conditional poll. The validation now polls until the log stabilizes or a 304 Not Modified is received to avoid false positives caused by background activity.
@johnsimons
johnsimons force-pushed the john/eventlog_etag_test_flake branch from e2740bc to ee2a455 Compare August 14, 2026 04:41
@johnsimons
johnsimons enabled auto-merge August 14, 2026 04:41
@johnsimons
johnsimons merged commit 64db54b into master Aug 14, 2026
54 checks passed
@johnsimons
johnsimons deleted the john/eventlog_etag_test_flake branch August 14, 2026 04:52
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.

2 participants