Skip to content

Commit 8335ed4

Browse files
t-bookAlessio Fabianiafabiani
authored
[Fixes GeoNode#6880] Circle CI upload tests fail irregulary (GeoNode#6881)
* [Fixes GeoNode#6880] Circle CI upload tests fail irregulary * CircleCI test fix: sometimes expires due to upload timeout in the test environment * - Avoid infinite loop on upload testing * Revert "CircleCI test fix: sometimes expires due to upload timeout in the test environment" This reverts commit 66139fd. Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it> Co-authored-by: afabiani <alessio.fabiani@gmail.com>
1 parent efaf1ab commit 8335ed4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
docker-compose -f docker-compose-test.yml exec db psql -U postgres -d test_geonode_data -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
108108
docker-compose -f docker-compose-test.yml exec django bash -c '<<parameters.test_suite>>'
109109
working_directory: ./
110+
no_output_timeout: 20m
110111
- run:
111112
name: Run pep8 checks
112113
command: |

geonode/upload/tests/integration.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def tearDownClass(cls):
136136

137137
def setUp(self):
138138
# await startup
139+
self.wait_for_progress_cnt = 0
139140
cl = Client(
140141
GEONODE_URL, GEONODE_USER, GEONODE_PASSWD
141142
)
@@ -169,6 +170,7 @@ def _post_teardown(self):
169170
pass
170171

171172
def tearDown(self):
173+
self.wait_for_progress_cnt = 0
172174
connections.databases['default']['ATOMIC_REQUESTS'] = False
173175

174176
for temp_file in self._tempfiles:
@@ -423,9 +425,12 @@ def wait_for_progress(self, progress_url):
423425
resp = self.client.get(progress_url)
424426
json_data = resp.json()
425427
# "COMPLETE" state means done
426-
if json_data.get('state', '') == 'RUNNING':
427-
time.sleep(0.1)
428+
if json_data.get('state', '') == 'RUNNING' and self.wait_for_progress_cnt < 300:
429+
time.sleep(1.0)
430+
self.wait_for_progress_cnt += 1
428431
self.wait_for_progress(progress_url)
432+
else:
433+
self.wait_for_progress_cnt = 0
429434

430435
def temp_file(self, ext):
431436
fd, abspath = tempfile.mkstemp(ext)

0 commit comments

Comments
 (0)