Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use foreach on iterable to prevent table locks during tests #11167

Merged

Conversation

bobvandevijver
Copy link
Contributor

Should fix table lock issues when merging into 3.x (see #11166). The iterator was not marked as finished, as this particular test case does not clear it records between the test, which meant that the test I added actually has 5 owners in the iterator.

By cleaning on setup and using a foreach which will yield only a single record, the iterator is closed and the table lock is released.

I am open for improvements to ensure the table contents is cleared between runs, but for now this works.

@bobvandevijver bobvandevijver force-pushed the fix-eager-iterable-loading-test branch from 8fe6f1b to 4875f4c Compare January 18, 2024 09:24
@greg0ire greg0ire added this to the 2.17.4 milestone Jan 18, 2024
@greg0ire greg0ire merged commit a0ed379 into doctrine:2.17.x Jan 18, 2024
54 checks passed
@greg0ire
Copy link
Member

Thanks @bobvandevijver !

@bobvandevijver bobvandevijver deleted the fix-eager-iterable-loading-test branch January 18, 2024 19:06
greg0ire added a commit to greg0ire/doctrine-orm that referenced this pull request Jan 20, 2024
…ble-loading-test

Use foreach on iterable to prevent table locks during tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants