Skip to content

Commit

Permalink
Net tests and new crash (#87)
Browse files Browse the repository at this point in the history
* export symbol used in tests

* Mark a few tls-using tests as net tests; fix crash on client creation failure due to tls init failure
  • Loading branch information
bretambrose authored Feb 12, 2021
1 parent e575343 commit e7f3dfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
21 changes: 10 additions & 11 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,17 @@ struct aws_s3_client *aws_s3_client_new(

aws_ref_count_init(&client->ref_count, client, (aws_simple_completion_callback *)s_s3_client_start_destroy);

aws_mutex_init(&client->synced_data.lock);

aws_linked_list_init(&client->synced_data.vips);
aws_linked_list_init(&client->synced_data.pending_vip_connection_updates);
aws_linked_list_init(&client->synced_data.pending_meta_request_work);

aws_linked_list_init(&client->threaded_data.idle_vip_connections);
aws_linked_list_init(&client->threaded_data.meta_requests);

/* Store our client bootstrap. */
client->client_bootstrap = client_config->client_bootstrap;
aws_client_bootstrap_acquire(client_config->client_bootstrap);
client->client_bootstrap = aws_client_bootstrap_acquire(client_config->client_bootstrap);

struct aws_event_loop_group *event_loop_group = client_config->client_bootstrap->event_loop_group;
aws_event_loop_group_acquire(event_loop_group);
Expand Down Expand Up @@ -309,15 +317,6 @@ struct aws_s3_client *aws_s3_client_new(
client->cached_signing_config = aws_cached_signing_config_new(client->allocator, client_config->signing_config);
}

aws_mutex_init(&client->synced_data.lock);

aws_linked_list_init(&client->synced_data.vips);
aws_linked_list_init(&client->synced_data.pending_vip_connection_updates);
aws_linked_list_init(&client->synced_data.pending_meta_request_work);

aws_linked_list_init(&client->threaded_data.idle_vip_connections);
aws_linked_list_init(&client->threaded_data.meta_requests);

client->synced_data.active = true;

if (client_config->retry_strategy != NULL) {
Expand Down
6 changes: 3 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file(GLOB TEST_SRC "*.c")
file(GLOB TEST_HDRS "*.h")
file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})

add_test_case(test_s3_client_create_destroy)
add_net_test_case(test_s3_client_create_destroy)
add_test_case(test_s3_request_create_destroy)

add_net_test_case(test_s3_client_exceed_retries)
Expand All @@ -16,8 +16,8 @@ add_net_test_case(test_s3_meta_request_sign_request_fail)
add_net_test_case(test_s3_meta_request_send_request_finish_fail)
add_net_test_case(test_s3_auto_range_put_missing_upload_id)

add_test_case(test_s3_vip_create_destroy)
add_test_case(test_s3_client_add_remove_vips)
add_net_test_case(test_s3_vip_create_destroy)
add_net_test_case(test_s3_client_add_remove_vips)
add_net_test_case(test_s3_client_resolve_vips)

add_net_test_case(test_s3_get_object_tls_disabled)
Expand Down

0 comments on commit e7f3dfe

Please sign in to comment.