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

PostgreSQL needs explicitly closed connection in functional test #762

Merged
merged 1 commit into from
Jan 3, 2015

Conversation

sarcher
Copy link
Contributor

@sarcher sarcher commented Jan 3, 2015

The test Doctrine\Tests\DBAL\Functional\ConnectionTest::testConnectWithoutExplicitDatabaseName prevents further tests in the suite from being run as the connection hangs around in PostgreSQL.

After this particular test, when the next DROP DATABASE is run, the log shows:

2015-01-03 00:21:28 PST ERROR: database "doctrine_tests" is being accessed by other users
2015-01-03 00:21:28 PST DETAIL: There is 1 other session using the database.
2015-01-03 00:21:28 PST STATEMENT: DROP DATABASE doctrine_tests

And the next functional test to be run produces something like:

  1. Doctrine\Tests\DBAL\Functional\ConnectionTest::testPingDoesTriggersConnect
    Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE DATABASE doctrine_tests':

SQLSTATE[42P04]: Duplicate database: 7 ERROR: database "doctrine_tests" already exists

...

This is with the following:

  • Debian Linux
  • PHP 5.5.9
  • PostgreSQL 9.3.5
  • PHPUnit 4.0.20
  • Process Isolation = off

Turning process isolation on does resolve the issue, but I assume that shouldn't be required. This doesn't seem to affect Travis.

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-1100

We use Jira to track the state of pull requests and the versions they got
included in.

@Ocramius
Copy link
Member

Ocramius commented Jan 3, 2015

This looks good to me. To be merged also in 2.4 and 2.5.

deeky666 added a commit that referenced this pull request Jan 3, 2015
PostgreSQL needs explicitly closed connection in functional test
@deeky666 deeky666 merged commit 38a7a2a into doctrine:master Jan 3, 2015
@deeky666
Copy link
Member

deeky666 commented Jan 3, 2015

@sarcher thx!

@deeky666
Copy link
Member

deeky666 commented Jan 3, 2015

Backported to 2.5 branch, The test does not exist in 2.4 so not backporting it to there.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants