Opened 12 years ago

Closed 12 years ago

#17268 closed Bug (fixed)

r17119 broke the cache tests under PostgreSQL on the CI server

Reported by: Aymeric Augustin Owned by: Aymeric Augustin
Component: Core (Cache system) Version:
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

test_add and test_cache_versioning_add fail, apparently because of an improper rollback.

Unfortunately, I can't reproduce this problem locally (OS X Lion, PostgreSQL 9.0 from MacPorts).

Attachments (1)

t17268.diff (1.2 KB ) - added by Florian Apolloner 12 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Aymeric Augustin, 12 years ago

The problem probably appeared as a consequence of the following changes:

  • I used a django.test.TestCase instead of a django.utils.unittest.TestCase because I wanted to apply the override_settings decorator,
  • I added transaction.commit() at the end of tearDown, otherwise the cache table isn't actually deleted, because django.test.TestCase is transactional.

comment:2 by Florian Apolloner, 12 years ago

I can reproduce it with Debian unstable, Postgres 9.0.5 and psycopg 2.4.2-1 -- The second cache.add in test_add fails due to a violated unique constraint (the same key already exists from the first add) and as a result of this the .get and .commit (in teardown) fails. I fixed it locally via the attached patch, but I am not sure if it's the correct way.

by Florian Apolloner, 12 years ago

Attachment: t17268.diff added

comment:3 by Aymeric Augustin, 12 years ago

Resolution: fixed
Status: newclosed

In [17131]:

Fixed #17268 -- Two failures in the cache tests.

Note: See TracTickets for help on using tickets.
Back to Top