Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31752 closed Bug (fixed)

Intermittent test failure on Windows with PostgreSQL

Reported by: Carlton Gibson Owned by: Carlton Gibson
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: Tests, Windows
Cc: Ahmad A. Hussein Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Reported by Ahmad on the forum, there's an intermittent test failure with Windows+Postgres.

(django) PS C:\Users\carlt\src\django\tests> python .\runtests.py --settings=test_postgres m2m_through.tests.M2mThroughTests
Testing against Django installed in 'c:\users\carlt\src\django\django'
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.....................F...................
======================================================================
FAIL: test_order_by_relational_field_through_model (m2m_through.tests.M2mThroughTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\carlt\src\django\tests\m2m_through\tests.py", line 247, in test_order_by_relational_field_through_model
    [self.jim, self.bob]
AssertionError: Sequences differ: <QuerySet [<Person: Person object (1)>, <Person: Person object (2)>]> != [<Person: Person object (2)>, <Person: Person object (1)>]

First differing element 0:
<Person: Person object (1)>
<Person: Person object (2)>

- <QuerySet [<Person: Person object (1)>, <Person: Person object (2)>]>
? ----------                         ^                            ^   -

+ [<Person: Person object (2)>, <Person: Person object (1)>]
?                          ^                            ^


----------------------------------------------------------------------
Ran 41 tests in 0.264s

FAILED (failures=1)
Destroying test database for alias 'default'...

Looks like a non-deterministic ordering problem.

Reproduced at 615e32162ff646db3456b90fb4eaaecc33dd3e4e.

Change History (3)

comment:1 by Carlton Gibson, 4 years ago

Has patch: set
Owner: changed from nobody to Carlton Gibson
Status: newassigned

PR -- see if that works...

comment:2 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In b5371539:

Fixed #31752 -- Fixed intermittent test_order_by_relational_field_through_model failure.

Set explicit datetime for M2M ordering test.

Thanks to Mariusz Felisiak for the suggestion.

comment:3 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 84640f5a:

[3.1.x] Fixed #31752 -- Fixed intermittent test_order_by_relational_field_through_model failure.

Set explicit datetime for M2M ordering test.

Thanks to Mariusz Felisiak for the suggestion.
Backport of b5371539a9d871758d639a85d1f2fd648c1f633d from master

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