Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25183 closed Bug (fixed)

Non-deterministic GeoIP test: GeoIPTest.test03_country

Reported by: Tim Graham Owned by: nobody
Component: GIS Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since enabling the GeoIP tests on Jenkins yesterday, this test has failed several times:

Traceback (most recent call last):
  File "/home/jenkins/workspace/pull-requests-trusty/database/postgres/label/trusty-pr/python/python2.7/tests/gis_tests/test_geoip.py", line 76, in test03_country
    self.assertEqual('US', func(query))
AssertionError: u'US' != u'TW'
- US
+ TW

Traceback (most recent call last):
  File "/home/jenkins/workspace/pull-requests-trusty/database/sqlite3/label/trusty-pr/python/python2.7/tests/gis_tests/test_geoip.py", line 78, in test03_country
    self.assertEqual('United States', func(query))
AssertionError: u'United States' != u'Taiwan'
- United States
+ Taiwan

Change History (8)

comment:1 by Tim Graham <timograham@…>, 9 years ago

In c041671:

Refs #25183 -- Added debugging for non-deterministic GeoIP test.

comment:2 by Tim Graham, 9 years ago

Resolution: worksforme
Status: newclosed

This hasn't reoccurred.

comment:3 by Tim Graham, 9 years ago

Spotted a recent failure on Jenkins:

Traceback (most recent call last):
  File "/home/jenkins/workspace/pull-requests-trusty/database/mysql_gis/label/trusty-pr/python/python3.4/tests/gis_tests/test_geoip.py", line 78, in test03_country
    self.assertEqual('United States', func(query), 'Failed for func %s and query %s' % (func, query))
AssertionError: 'United States' != 'Vietnam'
- United States
+ Vietnam
 : Failed for func <bound method GeoIP.country_name of <django.contrib.gis.geoip.base.GeoIP object at 0x7f848912cbe0>> and query www.google.com

Could it be an issue because Google has servers all over the world? (not exactly sure how GeoIP lookup works). We could try switching to something like djangoproject.com which only has servers in the US.

comment:4 by Tim Graham, 9 years ago

Resolution: worksforme
Status: closednew

comment:5 by Tim Graham, 9 years ago

Has patch: set

comment:6 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 5b6ca150:

Fixed #25183 -- Fixed non-deterministic GeoIP test.

google.com doesn't always resolve to an IP inside the United States.

comment:7 by Tim Graham <timograham@…>, 9 years ago

In 4fc5b487:

[1.7.x] Fixed #25183 -- Fixed non-deterministic GeoIP test.

google.com doesn't always resolve to an IP inside the United States.

Backport of 5b6ca150730cddb09ff8622d49b273d57b9c6703 from master

comment:8 by Tim Graham <timograham@…>, 9 years ago

In 77566dcc:

[1.8.x] Fixed #25183 -- Fixed non-deterministic GeoIP test.

google.com doesn't always resolve to an IP inside the United States.

Backport of 5b6ca150730cddb09ff8622d49b273d57b9c6703 from master

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