Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
fix test that fails locally but is excluded on the CI servers
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuehlke committed Sep 27, 2017
1 parent c1155d6 commit d4980a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cate/webapi/wsmanag.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ def _invoke_method(self):
msg = progress.get('message')

if not started:
if total is not None or total is not None:
self.monitor.start(label, total_work=total)
started = True
if label is None:
label = "start"
self.monitor.start(label, total_work=total)
started = True

if started:
if worked:
Expand Down
4 changes: 3 additions & 1 deletion test/core/test_wsmanag.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def test_resource_progress(self):
dict(),
res_name='noop',
monitor=rm)
# the websocket clients send always progress with 'None' arguments after start
cleaned_records = [r for r in rm.records if len(r) < 2 or r[1] is not None]
self.assertEquals([
('start', 'Computing nothing', 10),
('progress', 1.0, 'Step 1 of 10 doing nothing', 10),
Expand All @@ -143,7 +145,7 @@ def test_resource_progress(self):
('progress', 1.0, 'Step 9 of 10 doing nothing', 90),
('progress', 1.0, 'Step 10 of 10 doing nothing', 100),
('done',)
], rm.records)
], cleaned_records)
self.del_base_dir(base_dir)

def test_session(self):
Expand Down

0 comments on commit d4980a7

Please sign in to comment.