Skip to content

Commit

Permalink
vcap: testing: capture TimeoutError and raise
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenli2000 committed Oct 10, 2024
1 parent 20925c4 commit fd01379
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vcap/vcap/testing/input_output_validation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gc
import logging
import random
from concurrent import futures
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
import sys
Expand Down Expand Up @@ -125,7 +126,10 @@ def _run_inference_on_images(images: List[np.ndarray], capsule: BaseCapsule):

for future, input_node in request_input:
# Postprocess the results
prediction = future.result(timeout=90)
try:
prediction = future.result(timeout=90)
except futures.TimeoutError as e:
raise TimeoutError("Wait for capsule process_frame result: TimeoutError!")

# Verify that the capsule performed correctly

Expand Down

0 comments on commit fd01379

Please sign in to comment.