2929#endif
3030
3131AWS_STATIC_STRING_FROM_LITERAL (s_http_proxy_env_var , "HTTP_PROXY" );
32+ AWS_STATIC_STRING_FROM_LITERAL (s_http_proxy_env_var_low , "http_proxy" );
3233AWS_STATIC_STRING_FROM_LITERAL (s_https_proxy_env_var , "HTTPS_PROXY" );
34+ AWS_STATIC_STRING_FROM_LITERAL (s_https_proxy_env_var_low , "https_proxy" );
3335
3436enum new_connection_result_type {
3537 AWS_NCRT_SUCCESS ,
@@ -465,13 +467,47 @@ static int s_test_connection_manager_single_connection(struct aws_allocator *all
465467 ASSERT_SUCCESS (s_wait_on_connection_reply_count (1 ));
466468
467469 ASSERT_SUCCESS (s_release_connections (1 , false));
470+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
468471
469472 ASSERT_SUCCESS (s_cm_tester_clean_up ());
470473
471474 return AWS_OP_SUCCESS ;
472475}
473476AWS_TEST_CASE (test_connection_manager_single_connection , s_test_connection_manager_single_connection );
474477
478+ static int s_test_connection_manager_proxy_envrionment_empty_string (struct aws_allocator * allocator , void * ctx ) {
479+ (void )ctx ;
480+ /* Set proxy related envrionment variables to empty string and make sure we just skip proxy */
481+ struct aws_string * empty = aws_string_new_from_c_str (allocator , "" );
482+ ASSERT_SUCCESS (aws_set_environment_value (s_http_proxy_env_var , empty ));
483+ ASSERT_SUCCESS (aws_set_environment_value (s_http_proxy_env_var_low , empty ));
484+ ASSERT_SUCCESS (aws_set_environment_value (s_https_proxy_env_var , empty ));
485+ ASSERT_SUCCESS (aws_set_environment_value (s_https_proxy_env_var_low , empty ));
486+
487+ struct cm_tester_options options = {
488+ .allocator = allocator ,
489+ .max_connections = 5 ,
490+ .use_proxy_env = true,
491+ };
492+
493+ ASSERT_SUCCESS (s_cm_tester_init (& options ));
494+
495+ s_acquire_connections (1 );
496+
497+ ASSERT_SUCCESS (s_wait_on_connection_reply_count (1 ));
498+
499+ ASSERT_SUCCESS (s_release_connections (1 , false));
500+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
501+
502+ ASSERT_SUCCESS (s_cm_tester_clean_up ());
503+ aws_string_destroy (empty );
504+
505+ return AWS_OP_SUCCESS ;
506+ }
507+ AWS_TEST_CASE (
508+ test_connection_manager_proxy_envrionment_empty_string ,
509+ s_test_connection_manager_proxy_envrionment_empty_string );
510+
475511static int s_test_connection_manager_single_http2_connection (struct aws_allocator * allocator , void * ctx ) {
476512 (void )ctx ;
477513
@@ -513,6 +549,7 @@ static int s_test_connection_manager_single_http2_connection_failed(struct aws_a
513549 ASSERT_SUCCESS (s_wait_on_connection_reply_count (1 ));
514550
515551 ASSERT_SUCCESS (s_release_connections (1 , false));
552+ ASSERT_UINT_EQUALS (1 , s_tester .connection_errors );
516553
517554 ASSERT_SUCCESS (s_cm_tester_clean_up ());
518555
@@ -543,6 +580,7 @@ static int s_test_connection_manager_single_http2_connection_with_settings(struc
543580 ASSERT_SUCCESS (s_wait_on_connection_reply_count (1 ));
544581
545582 ASSERT_SUCCESS (s_release_connections (1 , false));
583+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
546584
547585 ASSERT_SUCCESS (s_cm_tester_clean_up ());
548586
@@ -567,6 +605,7 @@ static int s_test_connection_manager_many_connections(struct aws_allocator *allo
567605 ASSERT_SUCCESS (s_wait_on_connection_reply_count (20 ));
568606
569607 ASSERT_SUCCESS (s_release_connections (20 , false));
608+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
570609
571610 ASSERT_SUCCESS (s_cm_tester_clean_up ());
572611
@@ -591,6 +630,7 @@ static int s_test_connection_manager_many_http2_connections(struct aws_allocator
591630 ASSERT_SUCCESS (s_wait_on_connection_reply_count (20 ));
592631
593632 ASSERT_SUCCESS (s_release_connections (20 , false));
633+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
594634
595635 ASSERT_SUCCESS (s_cm_tester_clean_up ());
596636
@@ -617,6 +657,7 @@ static int s_test_connection_manager_acquire_release(struct aws_allocator *alloc
617657
618658 ASSERT_SUCCESS (s_wait_on_connection_reply_count (i + 1 ));
619659 }
660+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
620661
621662 ASSERT_SUCCESS (s_cm_tester_clean_up ());
622663
@@ -643,6 +684,7 @@ static int s_test_connection_manager_close_and_release(struct aws_allocator *all
643684
644685 ASSERT_SUCCESS (s_wait_on_connection_reply_count (i + 1 ));
645686 }
687+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
646688
647689 ASSERT_SUCCESS (s_cm_tester_clean_up ());
648690
@@ -675,6 +717,7 @@ static int s_test_connection_manager_acquire_release_mix(struct aws_allocator *a
675717
676718 ASSERT_SUCCESS (s_wait_on_connection_reply_count (i + 1 ));
677719 }
720+ ASSERT_UINT_EQUALS (0 , s_tester .connection_errors );
678721
679722 ASSERT_SUCCESS (s_cm_tester_clean_up ());
680723
0 commit comments