Skip to content

Commit

Permalink
fix #536 'test_websave_3' failed randomly due to distant server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software committed Nov 2, 2021
1 parent 996c905 commit 19ac894
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,8 @@

- [#533](http://github.com/Nelson-numerical-software/nelson/issues/533): `find` with one lhs did not return expected result with complex.

- [#536](http://github.com/Nelson-numerical-software/nelson/issues/536): `test_websave_3` failed randomly due to distant server.

# 0.5.10 (2021-10-30)

- Polynomial functions:
Expand Down
21 changes: 13 additions & 8 deletions modules/webtools/tests/test_websave_3.m
Expand Up @@ -25,15 +25,20 @@
%=============================================================================
url = 'http://neowms.sci.gsfc.nasa.gov/wms/wms';
filename = [tempdir(), 'earth.jpg'];
haveFails = false;
try
testPass = false;
i = 0;
retry = true;
while (retry)
try
destination_filename = websave(filename, url, 'Time', '2019-06-01', 'Service', 'WMS', 'Layers', 'BlueMarbleNG-TB', 'CRS', 'CRS:84', 'Format', 'image/jpeg', 'Height',768, 'Width', 1024,'BBOX','-180.0,-90.0,180.0,90.0','Version','1.3.0','Request','GetMap');
catch ex
if strcmp(ex.message, "Bad Request (400)") == 0
haveFails = false;
else
haveFails = true;
catch ex
testPass = (strcmp(ex.message, 'Bad Request (400)') == 1);
if ~testPass
testPass = (strcmp(ex.message, _('Timeout was reached')) == 1);
end
end
i = i + 1;
retry = ~testPass && (i < 5);
end
assert_istrue(haveFails);
assert_istrue(testPass)
%=============================================================================

0 comments on commit 19ac894

Please sign in to comment.