Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/iris/tests/test_image_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from threading import Thread

# maximum number of threads for multi-threading code
MAXTHREADS = 128
MAXTHREADS = 8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems sensible, given your analysis of run times


# Turn down requests logging
logging.getLogger("requests").setLevel(logging.CRITICAL)
Expand All @@ -58,8 +58,7 @@ def run(self):
resource = self.queue.get()
try:
result = requests.head(resource)
if (result.status_code == 200 and
resource.startswith('https://scitools.github.io')):
if result.status_code == 200:
self.deque.append(resource)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with this logic change

else:
msg = '{} is not resolving correctly.'.format(resource)
Expand All @@ -80,7 +79,11 @@ def test_resolve(self):
exceptions = deque()
uri_queue = Queue()
for uri in uris:
uri_queue.put(uri)
if uri.startswith('https://scitools.github.io'):
uri_queue.put(uri)
else:
msg = '{} is not a valid resource.'.format(uri)
exceptions.append(ValueError(msg))

for i in range(MAXTHREADS):
_ResolveWorkerThread(uri_queue, uri_list, exceptions).start()
Expand Down