Fix valgrind issues in E2E tests (#2192)

* handle IoTHubDeviceTwin_GetTwin network error

* pr feedback

* Fix valgrind issues in E2E tests
This commit is contained in:
Eric Wolz 2022-01-13 17:58:02 -08:00 коммит произвёл GitHub
Родитель e3f6b264b7
Коммит 42078edd24
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -905,6 +905,11 @@ void dt_e2e_send_module_id_test(IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol, IOTHU
char *twinData = dt_e2e_get_twin_from_service(serviceClientDeviceTwinHandle, deviceToUse);
IoTHubDeviceTwin_Destroy(serviceClientDeviceTwinHandle);
IoTHubServiceClientAuth_Destroy(iotHubServiceClientHandle);
destroy_on_device_or_module();
device_desired_deinit(deviceDesiredData);
JSON_Value *rootValue = json_parse_string(twinData);
ASSERT_IS_NOT_NULL(rootValue);
JSON_Object *rootObject = json_value_get_object(rootValue);
@ -916,10 +921,6 @@ void dt_e2e_send_module_id_test(IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol, IOTHU
// cleanup
json_value_free(rootValue);
free(twinData);
IoTHubDeviceTwin_Destroy(serviceClientDeviceTwinHandle);
IoTHubServiceClientAuth_Destroy(iotHubServiceClientHandle);
destroy_on_device_or_module();
device_desired_deinit(deviceDesiredData);
}

Просмотреть файл

@ -607,7 +607,7 @@ static void client_connect_to_hub(IOTHUB_PROVISIONED_DEVICE* deviceToUse, IOTHUB
if (test_protocol_type == TEST_AMQP || test_protocol_type == TEST_AMQP_WEBSOCKETS)
{
unsigned int svc2cl_keep_alive_timeout_secs = 120; // service will send pings at 120 x 7/8 = 105 seconds. Higher the value, lesser the frequency of service side pings.
size_t svc2cl_keep_alive_timeout_secs = 120; // service will send pings at 120 x 7/8 = 105 seconds. Higher the value, lesser the frequency of service side pings.
setoption_on_device_or_module(OPTION_SERVICE_SIDE_KEEP_ALIVE_FREQ_SECS, &svc2cl_keep_alive_timeout_secs, "Cannot set OPTION_SERVICE_SIDE_KEEP_ALIVE_FREQ_SECS");
// Set keep alive for remote idle is optional. If it is not set the default ratio of 1/2 will be used. For default value of 4 minutes, it will be 2 minutes (120 seconds)