Skip to content

Stabilise e2e logout propagation test (backport #37403)#37404

Closed
silverwind wants to merge 1 commit intogo-gitea:release/v1.26from
silverwind:fix-e2e-logout-flake-v1.26
Closed

Stabilise e2e logout propagation test (backport #37403)#37404
silverwind wants to merge 1 commit intogo-gitea:release/v1.26from
silverwind:fix-e2e-logout-flake-v1.26

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Apr 24, 2026

Backport of #37403 to release/v1.26.

The events › logout propagation e2e test was racing the SSE connection setup: if page2's SharedWorker had not finished registering its messenger by the time page1 triggered logout, the event was silently dropped and page2 stayed on the authenticated page.

Wait 500ms after verifying page2 is signed in, before triggering the logout from page1, so the SharedWorker has time to register. Comment points at a cleaner future fix (expose a ready attribute on the page) that will also work for the planned WebSocket SharedWorker.


This PR was written with the help of Claude Opus 4.7

Wait for page2's `/user/events` SSE response before triggering logout on
page1. Without this, the shared worker's EventSource may not have registered
a messenger on the server yet when `SignOut` calls `SendMessageBlocking`,
causing the logout event to be silently dropped and page2 to never redirect.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 24, 2026
@GiteaBot GiteaBot added this to the 1.26.1 milestone Apr 24, 2026
@silverwind silverwind changed the title Fix flaky e2e logout propagation test (backport v1.26) Fix flaky e2e logout propagation test Apr 24, 2026
@silverwind silverwind added type/testing skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Apr 24, 2026
@silverwind
Copy link
Copy Markdown
Member Author

Actually this cherry-picks cleanly so we can use giteabot to do it.

@silverwind silverwind closed this Apr 24, 2026
@silverwind silverwind changed the title Fix flaky e2e logout propagation test Fix logout event race for concurrent tab connections Apr 24, 2026
@GiteaBot GiteaBot removed this from the 1.26.1 milestone Apr 24, 2026
@silverwind silverwind changed the title Fix logout event race for concurrent tab connections Stabilise e2e logout propagation test (backport #37403) Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants