﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21222	document that ./runtests.py must use different databases for 'default' and 'other'.	Vernon Cole	nobody	"I decided to get off my duff and start testing django-mssql using django 1.6 -- to see whether that 1.6 compatible code I put in really works.

The first step is to get a set of baseline runs of the test suite. 

I checked out the git master & did ./runtests.py --settings=test_sqlite ... everything great.
Ran 6211 tests in 263.111s
OK (skipped=331, expected failures=11)

I made another setting like this:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'adotest',
            'USER': 'adotestuser',
            'PASSWORD': '12345678',
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,  # should be ignored in django 1.6
                },
            },
        'other': {
            'ENGINE': 'django.db.backends.sqlite3',
        }
    }

$ ./runtests.py --settings=test_pg_lite
Ran 6211 tests in 680.520s
OK (skipped=249, expected failures=11)

So lets try with both databases using PostgresSQL...

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'adotest',
            'USER': 'adotestuser',
            'PASSWORD': '12345678',
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,
                },
            },
        'other': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'adotest',
            ## 'TEST_NAME': 'other_test',
            'USER': 'adotestuser',
            'PASSWORD': '12345678',
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,
                },
        }
    }

 $ ./runtests.py --settings=test_pg
<It prints a screenfull of dots and then stops.  I left it running all night -- no progress.>
<After several retries, I found that if I kill the PostgreSQL instance I get...>
Ran 4826 tests in 1489.312s
FAILED (failures=27, errors=1482, skipped=239, expected failures=10)

The first of the 1482 tracebacks after I killed the server was:

    ======================================================================
    ERROR: test_fixture_loading (multiple_database.tests.FixtureTestCase)
    Multi-db fixtures are loaded correctly
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File ""/home/vernon/PycharmProjects/django/django/test/testcases.py"", line 173, in __call__
        self._pre_setup()
      File ""/home/vernon/PycharmProjects/django/django/test/testcases.py"", line 719, in _pre_setup
        self._fixture_setup()
      File ""/home/vernon/PycharmProjects/django/django/test/testcases.py"", line 853, in _fixture_setup
        self._fixture_teardown()
      File ""/home/vernon/PycharmProjects/django/django/test/testcases.py"", line 865, in _fixture_teardown
        self.atomics[db_name].__exit__(None, None, None)
      File ""/home/vernon/PycharmProjects/django/django/db/transaction.py"", line 352, in __exit__
        connection.set_autocommit(True)
      File ""/home/vernon/PycharmProjects/django/django/db/backends/__init__.py"", line 335, in set_autocommit
        self._set_autocommit(autocommit)
      File ""/home/vernon/PycharmProjects/django/django/db/backends/postgresql_psycopg2/base.py"", line 186, in _set_autocommit
        self.connection.autocommit = autocommit
    InterfaceError: connection already closed


Was it me being clumsy, or is this a major bug?"	Cleanup/optimization	closed	Testing framework	dev	Normal	fixed	runtests infinite wait	Vernon Cole	Unreviewed	0	0	0	0	0	0
