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

Optimize sharing test connection #4991

Merged
merged 2 commits into from Nov 15, 2021

Conversation

morozov
Copy link
Member

@morozov morozov commented Nov 15, 2021

Q A
Type improvement
BC Break no

The #4967 tests have been failing with Oracle-based drivers with the following error messages:

ORA-12519: TNS:no appropriate service handler found

While the root cause isn't exactly clear, it is clear that the test suite attempts to establish an abnormally large number of connections which the containerized database server starts rejecting at some point in time.

The large number of connections is caused by the fact that the schema manager tests mark the connection as non-reusable during the teardown. This is necessary to avoid the side effects produced by the following tests:

  1. MySQLSchemaManagerTest::testSpatialIndex() creates a table with a column of type POINT. Due to Adding Custom Type after doctrineTypeComments member was touched results in missing comments on schema #4983, the pre-existing shared connection won't be able to use this type during table introspection. Because of that, any subsequent test that tries to introspect the schema will fail.
  2. PostgreSQLSchemaManagerTest::testFilterSchemaExpression() modifies the asset filtering configuration on the shared connection. If this connection is used by subsequent tests, they will fail to introspect the assets that don't match the filter.

Each of the schema manager tests establishes a connection in order to identify the current platforms and skips if it doesn't support the platform. Combined with marking the connection non-reusable, all schema manager tests combined establish ~400 connections per test suite, most of which get immediately closed because all schema manager tests except one don't support the currently configured database platform.

The solution is to have each individual test mark the connection as non-reusable (2 out of ~400).

@derrabus derrabus merged commit fa27901 into doctrine:3.1.x Nov 15, 2021
@morozov morozov deleted the optimize-sharing-test-connection branch November 15, 2021 15:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants