Opened 5 years ago

Closed 5 years ago

#30617 closed Bug (worksforme)

test_check_constraints sometimes fails with no such table error.

Reported by: Jakub Kulík Owned by: nobody
Component: Testing framework Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

since the 1.11.22 version of Django we sometimes get an error when running a test suite:

test_check_constraints (backends.tests.FkConstraintsTests) ... ERROR

I tried to find the exact problem but was unsuccessful. It doesn't happen when just a single test is run, I wasn't able to reproduce it when backends only tests were run either and even when the entire test suite is run, it only manifests itself sometimes (and when it does, it is always just this single test).

We never saw this in 1.11.20 or any previous version.

Here is an entire error message:

======================================================================
ERROR: test_check_constraints (backends.tests.FkConstraintsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/.../django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/.../django/db/backends/sqlite3/base.py", line 326, in execute
    return Database.Cursor.execute(self, query)
sqlite3.OperationalError: no such table: alter_alter_field_reloads_state_on_fk_target_changes_pony__old

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/.../tests/backends/tests.py", line 1026, in test_check_constraints
    connection.check_constraints()
  File "/.../django/db/backends/sqlite3/base.py", line 286, in check_constraints
    column_name, referenced_column_name,
  File "/.../django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/.../django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/.../django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/.../django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/.../django/db/backends/sqlite3/base.py", line 326, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: no such table: alter_alter_field_reloads_state_on_fk_target_changes_pony__old

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: worksforme
Status: newclosed
Summary: test_check_constraints sometimes fails with no such table errortest_check_constraints sometimes fails with no such table error.

Thanks for this report, however I'm not able to reproduce this issue also this hasn't happened on DjangoCI. Moreover we don't have any changes in the Django ORM or in this test between versions 1.11.20 and 1.11.22.

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