Opened 4 years ago

Closed 4 years ago

#32168 closed Cleanup/optimization (fixed)

Remove serial pk assumptions in aggregation_regress tests

Reported by: Tim Graham Owned by: Christopher Wang
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

CockroachDB doesn't use serial pks and some tests fail. Feel free to mention me on your pull request if you cannot test your changes on CockroachDB.

======================================================================
FAIL: test_more_more (aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/aggregation_regress/tests.py", line 702, in test_more_more
    self.assertSequenceEqual(
AssertionError: Sequences differ: <QuerySet [{'pub': 604193433639452673, 'i[145 chars] 1}]> != [{'pub': 604193433675366401, 'id__count':[134 chars]: 1}]

First differing element 0:
{'pub': 604193433639452673, 'id__count': 2}
{'pub': 604193433675366401, 'id__count': 2}

- <QuerySet [{'pub': 604193433639452673, 'id__count': 2}, {'pub': 604193433646432257, 'id__count': 1}, {'pub': 604193433652854785, 'id__count': 2}, {'pub': 604193433659506689, 'id__count': 1}]>
+ [{'id__count': 2, 'pub': 604193433675366401},
+  {'id__count': 1, 'pub': 604193433690800129},
+  {'id__count': 2, 'pub': 604193433704824833},
+  {'id__count': 1, 'pub': 604193433718816769}]

======================================================================
FAIL: test_more_more_more (aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/aggregation_regress/tests.py", line 880, in test_more_more_more
    self.assertEqual(
AssertionError: Lists differ: [] != ['Apress', 'Sams']

Second list contains 2 additional elements.
First extra element 0:
'Apress'

- []
+ ['Apress', 'Sams']

======================================================================
FAIL: test_ticket_11293 (aggregation_regress.tests.AggregationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/aggregation_regress/tests.py", line 1452, in test_ticket_11293
    self.assertQuerysetEqual(
  File "/home/tim/code/django/django/test/testcases.py", line 1053, in assertQuerysetEqual
    return self.assertEqual(list(items), values, msg=msg)
AssertionError: Lists differ: [604193433675366401, 604193433718816769, 604193433732775937, 604193433807945729] != [1, 4, 5, 6]

First differing element 0:
604193433675366401
1

- [604193433675366401, 604193433718816769, 604193433732775937, 604193433807945729]
+ [1, 4, 5, 6]

Change History (8)

comment:1 by Mariusz Felisiak, 4 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Christopher Wang, 4 years ago

Owner: changed from nobody to Christopher Wang
Status: newassigned

comment:3 by Christopher Wang, 4 years ago

Has patch: set

PR: https://github.com/django/django/pull/13639

@Tim Graham, should another patch be made for stable/3.1.x, or is this mainly for future development on django-cockroachdb?

in reply to:  3 ; comment:4 by Mariusz Felisiak, 4 years ago

Replying to christopherwang:

PR: https://github.com/django/django/pull/13639

@Tim Graham, should another patch be made for stable/3.1.x, or is this mainly for future development on django-cockroachdb?

Christopher, another patch is not necessary, also this doesn't qualify for a backport.

in reply to:  4 comment:5 by Christopher Wang, 4 years ago

Replying to Mariusz Felisiak:

Replying to christopherwang:

PR: https://github.com/django/django/pull/13639

@Tim Graham, should another patch be made for stable/3.1.x, or is this mainly for future development on django-cockroachdb?

Christopher, another patch is not necessary, also this doesn't qualify for a backport.

Sounds good! Just wanted to make sure to follow through if more was necessary.

comment:6 by Tim Graham, 4 years ago

Triage Stage: AcceptedReady for checkin

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

In 77e93d3:

Refs #32168 -- Fixed Publisher assertions in AggregationTests.test_more_more.

Refer to Publisher objects instead of Books.

Test regression in 1bf25e9bc6df6c2ae4c0b10fb839e101471e8373.

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

Resolution: fixed
Status: assignedclosed

In 2f6312fc:

Fixed #32168 -- Removed serial pk assumption in aggregation_regress tests.

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