Opened 10 years ago

Closed 22 months ago

#23842 closed Bug (fixed)

Transient failure of django.contrib.gis.tests.geoapp.tests.GeoQuerySetTest.test_make_line

Reported by: Simon Charette Owned by: Mariusz Felisiak
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: t.chaumeny@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Traceback (most recent call last):
  File "/home/jenkins/workspace/django-master/database/postgis/python/python3.2/django/test/testcases.py", line 959, in skip_wrapper
    return test_func(*args, **kwargs)
  File "/home/jenkins/workspace/django-master/database/postgis/python/python3.2/django/contrib/gis/tests/geoapp/tests.py", line 632, in test_make_line
    self.assertTrue(ref_line.equals_exact(City.objects.make_line(), tolerance=10e-5))
AssertionError: False is not true

Change History (13)

comment:1 by Thomas C, 10 years ago

That looks like a floating point error due to the underlying library implementation. This test used to fail more often before tolerance was added (see also https://github.com/django/django/commit/9f576dd54fafdd76aa250f8947cc76c7ae19216c).

Can you reproduce the failure on your machine ? — I can't on mine even if I run the test a hundred time.

comment:2 by Simon Charette, 10 years ago

Couldn't reproduce locally with 80 tries... I suggest we keep this ticket open as a reference until we figure out how to deal with this.

comment:3 by Claude Paroz, 10 years ago

I suspect an issue with ordering, but simply adding an order_by() will not be enough. The ST_MakeLine documentation suggests to solve this by using the PostgreSQL 9+ ORDER BY support for aggregates. So the proper fix might not be trivial.

http://postgis.net/docs/ST_MakeLine.html

comment:4 by Thomas C, 10 years ago

That might be an explanation. What about adding some message like self.assertTrue(ref_line.equals_exact(line, tolerance=10e-5), "%s != %s" % (ref_line, line)) so that we can see the actual differences ?

comment:5 by Claude Paroz <claude@…>, 10 years ago

In fc3643743456e98ceb902ee1e48c1bc5f56034cf:

Added assertion error message for test_make_line

Refs #23842. Thanks Thomas Chaumeny for the suggestion.

comment:6 by Thomas C, 10 years ago

Cc: t.chaumeny@… added

comment:7 by Tim Graham, 7 years ago

Resolution: worksforme
Status: newclosed

I haven't seen this failure recently.

comment:8 by Tim Graham, 7 years ago

Resolution: worksforme
Status: closednew

I saw this on Jenkins (a pull request to the master branch) today.

File "python3.6/tests/gis_tests/geoapp/tests.py", line 540, in test_make_line
    "%s != %s" % (ref_line, line)
AssertionError: False is not true :

SRID=4326;LINESTRING (-95.363151 29.763374, -96.80161099999999 32.782057, -97.521157 34.464642, 174.783117 -41.315268, -104.609252 38.255001, -95.23506 38.971823, -87.650175 41.850385, -123.305196 48.462611)
!=
 SRID=4326;LINESTRING (-104.609252 38.255001, -95.23506 38.971823, -87.650175 41.850385, -123.305196 48.462611, -95.363151 29.763374, -96.80161099999999 32.782057, -97.521157 34.464642, 174.783117 -41.315268)

comment:9 by Mariusz Felisiak, 2 years ago

Resolution: worksforme
Status: newclosed

I haven't seen this failure in the last 2-3 years.

comment:10 by Mariusz Felisiak, 22 months ago

Resolution: worksforme
Status: closednew

comment:11 by Mariusz Felisiak, 22 months ago

It started failing again:

False is not true : SRID=4326;LINESTRING (-95.363151 29.763374, -96.80161099999999 32.782057, -97.521157 34.464642, 174.783117 -41.315268, -104.609252 38.255001, -95.23506 38.971823, -87.650175 41.850385, -123.305196 48.462611) != SRID=4326;LINESTRING (-87.650175 41.850385, -123.305196 48.462611, -95.363151 29.763374, -96.80161099999999 32.782057, -97.521157 34.464642, 174.783117 -41.315268, -104.609252 38.255001, -95.23506 38.971823)

comment:12 by Mariusz Felisiak, 22 months ago

Has patch: set
Owner: changed from nobody to Mariusz Felisiak
Status: newassigned

comment:13 by GitHub <noreply@…>, 22 months ago

Resolution: fixed
Status: assignedclosed

In 6774e935:

Fixed #23842 -- Fixed flaky GeoQuerySetTest.test_make_line() test.

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