Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_get_map fails on 1-core VM #522

Open
bmwiedemann opened this issue Jun 15, 2021 · 0 comments
Open

test_get_map fails on 1-core VM #522

bmwiedemann opened this issue Jun 15, 2021 · 0 comments

Comments

@bmwiedemann
Copy link

Context

While working on on reproducible builds for openSUSE, I found that our python-MapProxy would not build in 1-core VMs because tests fail.

Expected Behavior

Tests should pass

Actual Behavior

 =================================== FAILURES ===================================
 ___________________________ TestWMS110.test_get_map ____________________________
 
 self = <mapproxy.test.system.test_wms.TestWMS110 object at 0x7fea4097c0d0>
 app = <mapproxy.test.system.WSGITestApp object at 0x7fea33fb33a0>
 cache_dir = local('/tmp/pytest-of-abuild/pytest-0/base_dir50/cache_data')
 
     def test_get_map(self, app, cache_dir):
         with tmp_image((256, 256), format="jpeg") as img: 
             expected_req = (
                 {
                     "path": r"/service?LAYERs=foo,bar&SERVICE=WMS&FORMAT=image%2Fjpeg"
                     "&REQUEST=GetMap&HEIGHT=256&SRS=EPSG%3A900913&styles="
                     "&VERSION=1.1.1&BBOX=0.0,0.0,20037508.3428,20037508.3428"
                     "&WIDTH=256"
                 },
                 {"body": img.read(), "headers": {"content-type": "image/jpeg"}},
             )
             with mock_httpd(
                 ("localhost", 42423), [expected_req], bbox_aware_query_comparator=True
             ):
                 self.common_map_req.params["bbox"] = "0,0,180,90"
                 resp = app.get(self.common_map_req)
 >               assert 35000 < int(resp.headers["Content-length"]) < 75000 
 E               AssertionError: assert 35000 < 594
 E                +  where 594 = int('594')
 
 mapproxy/test/system/test_wms.py:1003: AssertionError
 ----------------------------- Captured stdout call -----------------------------
 requests mismatch:
  -  requests mismatch (requests differ), expected:
         /service?LAYERs=foo,bar&SERVICE=WMS&FORMAT=image%2Fjpeg&REQUEST=GetMap&HEIGHT=256&SRS=EPSG%3A900913&styles=&VERSION=1.1.1&BBOX=0.0,0.0,20037508.3428,20037508.3428&WIDTH=256
       got:
         /service?layers=foo,bar&format=image%2Fjpeg&bbox=0.0,0.0,10018754.171394622,10018754.171394622&width=256&height=256&srs=EPSG%3A900913&request=GetMap&version=1.1.1&service=WMS&styles=
  -  requests mismatch (requests params differ), expected:
         {('bbox', '0.0,0.0,20037508.3428,20037508.3428')}
       got:
         {('bbox', '0.0,0.0,10018754.171394622,10018754.171394622')}
 ------------------------------ Captured log call -------------------------------
 WARNING  mapproxy.source.wms:wms.py:100 could not retrieve WMS map: Internal HTTP error "http://localhost:42423/service?layers=foo,bar&format=image%2Fjpeg&bbox=0.0,0.0,20037508.342789244,20037508.342789244&width=256&height=256&srs=EPSG%3A900913&request=GetMap&version=1.1.1&service=WMS&styles=": ConnectionResetError(104, 'Connection reset by peer')
[...]
 FAILED mapproxy/test/system/test_wms.py::TestWMS110::test_get_map - Assertion...
 FAILED mapproxy/test/system/test_wms.py::TestWMS100::test_get_map - Assertion...
 FAILED mapproxy/test/system/test_wms.py::TestWMS130::test_get_map - Assertion...
 ==== 3 failed, 1617 passed, 38 skipped, 41 deselected, 8 warnings in 31.08s ====

Possible Fix

Steps to Reproduce

  1. have a Debian or openSUSE Linux with osc + obs-build installed
  2. osc co openSUSE:Factory/python-MapProxy && cd $_
  3. osc build --vm-type=kvm -j1 --noservice --clean standard

Maybe can also be trigged by running tests as taskset 1 pytest

Context

Your Environment

  • Version used: MapProxy-1.13.0
  • Environment name and version: python 3.8.10
  • Operating System and version: openSUSE Tumbleweed 20210610 ; no Internet during build+test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant