From a7fe20bfdada4ab189a7af749929ba82d0707a6b Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Fri, 2 Jan 2009 18:24:49 +0000 Subject: [PATCH] Added note for mssql about using snapshot isolation in order to get multiple connection session tests to pass. --- README.unittests | 11 +++++++++++ test/orm/session.py | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.unittests b/README.unittests index 0051ce6145..87f8e20d6c 100644 --- a/README.unittests +++ b/README.unittests @@ -177,3 +177,14 @@ Postgres: When running the tests on postgres, postgres can get slower and slower each time you run the tests. This seems to be related to the constant creation/dropping of tables. Running a "VACUUM FULL" on the database will speed it up again. + +MSSQL: Tests that involve multiple connections require Snapshot Isolation +ability implented on the test database in order to prevent deadlocks that will +occur with record locking isolation. This feature is only available with +MSSQL 2005 and greater. For example:: + + ALTER DATABASE MyDatabase + SET ALLOW_SNAPSHOT_ISOLATION ON + + ALTER DATABASE MyDatabase + SET READ_COMMITTED_SNAPSHOT ON diff --git a/test/orm/session.py b/test/orm/session.py index 6114a02129..782688e13c 100644 --- a/test/orm/session.py +++ b/test/orm/session.py @@ -162,7 +162,6 @@ class SessionTest(_fixtures.FixtureTest): assert len(session.query(User).filter_by(name='Johnny').all()) == 0 session.close() - @testing.crashes('mssql', 'test causes mssql to hang') @testing.requires.independent_connections @engines.close_open_connections @testing.resolve_artifact_names @@ -182,7 +181,6 @@ class SessionTest(_fixtures.FixtureTest): assert testing.db.connect().execute("select count(1) from users").scalar() == 1 sess.close() - @testing.crashes('mssql', 'test causes mssql to hang') @testing.requires.independent_connections @engines.close_open_connections @testing.resolve_artifact_names @@ -232,7 +230,6 @@ class SessionTest(_fixtures.FixtureTest): eq_(q.one(), Address(email_address='foo')) - @testing.crashes('mssql', 'test causes mssql to hang') @testing.requires.independent_connections @engines.close_open_connections @testing.resolve_artifact_names @@ -391,7 +388,6 @@ class SessionTest(_fixtures.FixtureTest): session.commit() assert session.connection().execute("select count(1) from users").scalar() == 2 - @testing.crashes('mssql', 'test causes mssql to hang') @testing.fails_on('sqlite', 'FIXME: unknown') @testing.resolve_artifact_names def test_transactions_isolated(self): -- 2.47.3