Repository navigation
test: keep TestCommandHelper fixtures intact for parallel subtests - #465
Merged
Merged
Conversation
func=Authenticate closed the shared Playwright browser as soon as its own login finished, while func=ListProjects, running in parallel, could still be logging in through it, which then failed with "target closed". The browser is now only closed by the parent's t.Cleanup, after all subtests have finished. func=SelectProjectWorkspace changed the project and workspace selected in the shared config file, which func=CreateProject copies in parallel. It now works on a copy of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DUBUDsgicGQri3GxrTV8VW
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
masterCI failed after #464 inTestCommandHelper/func=ListProjects(run): its browser login died withtarget closed: Target page, context or browser has been closed. Staging did not reject anything; the browser was closed while the login was still running.Two parallel subtests share one Playwright browser.
func=Authenticatecalledcleanup()as soon as its own login finished, which closes the page, the browser and Playwright, whilefunc=ListProjectscould still be logging in through that browser. This race has existed since 2024; the identifier-first console login from #464 makes the first login inListProjectstake an extra step, while the session reconfirmation inAuthenticatestill takes one, soAuthenticatenow tends to finish first. The browser is now only closed by the parent'st.Cleanup, which runs after all subtests have finished.While looking for similar problems across the cloudx tests, I found one more in the same test:
func=SelectProjectWorkspacechanged the selected project and workspace in the config file shared by all subtests, whichfunc=CreateProjectcopies in parallel and could read half-written or with the other selection. It now works on a copy, likefunc=CreateProjectalready does.Related Issue or Design Document
Follow-up to #464; fixes the
masterCI failure linked above.Checklist
and signed the CLA.
introduces a new feature.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got approval (please contact
security@ory.com) from the maintainers to push
the changes.
works.
appropriate).
Further comments
go test -race -count=1 -run '^TestCommandHelper$' ./cmd/cloudx/client/passes against staging. A single pass cannot prove a race is gone; the argument is that nothing closes the browser beforet.Cleanupanymore. In that runListProjectswas still logging in afterAuthenticatehad finished its login, so the old code would have failed it.defaultConfig,defaultProject,extraProject, the browser) and found none: tests that write project configuration already use their own project, config-changing tests use a copy, and the tests that assert exact list contents either own their project or are its only writer.func=UpdateProjectreplaces the configuration of the shareddefaultProjectwhile parallel siblings use that project, but they only assert on its ID and on empty identity, client and relation tuple lists, which a configuration change does not affect. Giving it its own project would add a workspace and a project to every run.🤖 Generated with Claude Code
https://claude.ai/code/session_01DUBUDsgicGQri3GxrTV8VW