diff --git a/servicetests/test_cases/test_jobs_execution.py b/servicetests/test_cases/test_jobs_execution.py index 40bdd3d46..368676b7e 100644 --- a/servicetests/test_cases/test_jobs_execution.py +++ b/servicetests/test_cases/test_jobs_execution.py @@ -12,6 +12,8 @@ import run_in_ci import ci_iot_thing +import time + def main(): argument_parser = argparse.ArgumentParser( diff --git a/servicetests/tests/JobsExecution/main.cpp b/servicetests/tests/JobsExecution/main.cpp index 9df3010e3..d5eb8f017 100644 --- a/servicetests/tests/JobsExecution/main.cpp +++ b/servicetests/tests/JobsExecution/main.cpp @@ -528,6 +528,9 @@ void getAvailableJobs(Aws::Crt::String thingName, IotJobsClient &jobsClient) publishDescribeJobExeCompletedPromise.get_future().wait(); fprintf(stderr, "get available jobs waiting iot core answer\n"); - getResponse.get_future().wait(); + if (getResponse.get_future().wait_for(std::chrono::seconds(10)) == std::future_status::timeout) { + fprintf(stderr, "get available jobs error timedout\n"); + exit (-1); + } fprintf(stderr, "get available jobs returning\n"); }