Skip to content

Commit

Permalink
Fix valgrind issues in E2E tests (#2192)
Browse files Browse the repository at this point in the history
* handle IoTHubDeviceTwin_GetTwin network error

* pr feedback

* Fix valgrind issues in E2E tests
  • Loading branch information
ericwolz committed Jan 14, 2022
1 parent e3f6b26 commit 42078ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}


Expand Down
2 changes: 1 addition & 1 deletion iothub_client/tests/common_e2e/iothubclient_common_e2e.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 42078ed

Please sign in to comment.