Opened 3 years ago

Closed 3 years ago

#17268 closed Bug (fixed)

r17119 broke the cache tests under PostgreSQL on the CI server

Reported by: aaugustin Owned by: aaugustin
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 apollo13 3 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 3 years ago by aaugustin

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 Changed 3 years ago by apollo13

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.

Changed 3 years ago by apollo13

comment:3 Changed 3 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [17131]:

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

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