Skip to content

Commit

Permalink
Set async test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Aug 21, 2024
1 parent 1d8b4f7 commit 62f95ce
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ stages:
- make test FLAVOR=$QGIS_FLAVOR
tags:
- factory-plain
variables:
ASYNC_TEST_TIMEOUT: "20"

tests:
extends: .tests
resource_group: py_qgis_wps_tests
parallel:
matrix:
- QGIS_FLAVOR: ['ltr', 'release', '3.28']
matrix:
- QGIS_FLAVOR: ['ltr', 'release', '3.28']

# Docker build
include: '/docker/.gitlab-ci.yml'
Expand Down
2 changes: 1 addition & 1 deletion pyqgiswps/poolserver/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def apply_async(
request = pickle.dumps((target, args, kwargs))
return self._apply_async(request, timeout)

async def _apply_async(self, request: bytes, timeout: int = 5) -> Any:
async def _apply_async(self, request: bytes, timeout: int) -> Any:
""" Run job asynchronously
"""
if len(self._handlers) > self._maxqueue:
Expand Down
3 changes: 2 additions & 1 deletion pyqgiswps/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def put(
path,
method='PUT',
body=data,
raise_error=False, headers=headers,
raise_error=False,
headers=headers,
),
)

Expand Down
31 changes: 24 additions & 7 deletions tests/unittests/processing/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ def test_mapcontext_describe(self):
def test_mapcontext_execute(self):
""" Test execute process with context
"""
rv = self.client.get(("/ows/?SERVICE=WPS&Request=Execute"
"&Identifier=pyqgiswps_test:testmapcontext&Version=1.0.0"
"&MAP=france_parts&DATAINPUTS=INPUT=hello_context"), path="")
rv = self.client.get(
(
"/ows/?SERVICE=WPS"
"&Request=Execute"
"&Identifier=pyqgiswps_test:testmapcontext"
"&Version=1.0.0"
"&MAP=france_parts&DATAINPUTS=INPUT=hello_context"
),
path="",
)
assert rv.status_code == 200
assert rv.xpath_text('//wps:ProcessOutputs/wps:Output/wps:Data/wps:LiteralData') == 'france_parts'

Expand All @@ -110,8 +117,13 @@ def test_status_location(self):
def test_proxy_url(self):
""" Test if proxy url is set
"""
uri = ('/ows/?service=WPS&request=Execute&Identifier=pyqgiswps_test:testcopylayer&Version=1.0.0'
'&MAP=france_parts&DATAINPUTS=INPUT=france_parts%3BOUTPUT=france_parts_2')
uri = (
'/ows/?service=WPS'
'&request=Execute'
'&Identifier=pyqgiswps_test:testcopylayer'
'&Version=1.0.0'
'&MAP=france_parts&DATAINPUTS=INPUT=france_parts%3BOUTPUT=france_parts_2'
)
proxy_loc = 'http://test.proxy.loc:8080/anyhwere/'

headers = {'X-Forwarded-Url': proxy_loc}
Expand Down Expand Up @@ -152,8 +164,13 @@ def test_proxy_url(self):
def test_service_url(self):
""" Test service url header
"""
uri = ('/ows/?service=WPS&request=Execute&Identifier=pyqgiswps_test:testcopylayer&Version=1.0.0'
'&MAP=france_parts&DATAINPUTS=INPUT=france_parts%3BOUTPUT=france_parts_2')
uri = (
'/ows/?service=WPS'
'&request=Execute'
'&Identifier=pyqgiswps_test:testcopylayer'
'&Version=1.0.0'
'&MAP=france_parts&DATAINPUTS=INPUT=france_parts%3BOUTPUT=france_parts_2'
)
proxy_loc = 'http://test.proxy.loc:8080/anyhwere/'

headers = {'X-Qgis-Service-Url': proxy_loc}
Expand Down

0 comments on commit 62f95ce

Please sign in to comment.