Opened 9 years ago

Last modified 9 years ago

#1237 defect closed fixed (fixed)

test_adbapi fails with "relation `simple' already exists" sometimes

Reported by: exarkun Owned by:
Priority: high Milestone:
Component: core Keywords: core
Cc: exarkun, davep Branch:
Author: Launchpad Bug:

Description


Change History (3)

comment:1 Changed 9 years ago by exarkun

===============================================================================
[ERROR]: twisted.test.test_adbapi.PyPgSQLReconnectTestCase.testPool

  File "/home/buildbot/run/full2.2/Twisted/twisted/internet/defer.py", line 109,
in maybeDeferred
    result = f(*args, **kw)
  File "/home/buildbot/run/full2.2/Twisted/twisted/test/test_adbapi.py", line
217, in setUp
    self.wait(self.dbpool.runOperation(simple_table_schema))
  File "/home/buildbot/run/full2.2/Twisted/twisted/test/test_adbapi.py", line
208, in wait
    return unittest.wait(d, timeout=timeout)
  File "/home/buildbot/run/full2.2/Twisted/twisted/trial/util.py", line 356, in wait
    r.raiseException()
  File "/home/buildbot/run/full2.2/Twisted/twisted/internet/threads.py", line
25, in _putResultInDeferred
    result = f(*args, **kwargs)
  File "/home/buildbot/run/full2.2/Twisted/twisted/enterprise/adbapi.py", line
375, in _runInteraction
    result = interaction(trans, *args, **kw)
  File "/home/buildbot/run/full2.2/Twisted/twisted/enterprise/adbapi.py", line
388, in _runOperation
    trans.execute(*args, **kw)
  File "/usr/lib/python2.2/site-packages/pyPgSQL/PgSQL.py", line 3072, in execute
    raise OperationalError, msg
libpq.OperationalError: ERROR:  relation "simple" already exists

-------------------------------------------------------------------------------

comment:2 Changed 9 years ago by davep

If for some reason the simple table is not deleted by tearDown,
subsequent tests would fail on setUp. I moved the simple test creation
into the test function so that tearDown will drop the table even if it
causes the test to fail, so the next test will succeed.

Better would be to detect if the table exists and drop it at the
start of the test, but that will require some more work, as it is
db-specific.

comment:3 Changed 3 years ago by <automation>

  • Owner davep deleted
Note: See TracTickets for help on using tickets.