Skip to content

Conversation

@alexislefebvre
Copy link
Collaborator

@alexislefebvre alexislefebvre commented Dec 11, 2025

Fixes GH-606

Split from:

TODO:

  • update QueryCounter so that it doesn’t fail if the annotation reader is not available, query.max_query_count should work on Symfony 7+ even without the support for annotations. Show a warning instead if the annotation can’t be read? The bundle need to the annotation reader to check if an @QueryCount(x) annotation was actually used…
  • consider adding an attribute QueryCount to replace the annotation on the long term

Update:

testAllowedQueriesExceededException worked because of query.max_query_count: 0, not because of the annotation. It was a false positive since e2fdc70 from

@alexislefebvre alexislefebvre force-pushed the feat-split-tests-of-query.max_query_count branch 3 times, most recently from 68c692a to 6171afd Compare December 11, 2025 20:32
@alexislefebvre alexislefebvre marked this pull request as draft December 11, 2025 21:19
@alexislefebvre alexislefebvre force-pushed the feat-split-tests-of-query.max_query_count branch from 6171afd to 0c3a63e Compare December 11, 2025 21:28
@alexislefebvre alexislefebvre marked this pull request as ready for review December 11, 2025 21:28
private function getMaxQueryAnnotation(): ?int
{
if (Kernel::MAJOR_VERSION >= 7) {
trigger_error('The annotationReader is not available and it can’t be enabled on Symfony 7+, @QueryCount is not supported', \E_USER_WARNING);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Providing this information is better than before, but this warning may not appear when running tests, so it may be ineffective.

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.

Restore test with max_query_count: 1

1 participant