Skip to content

Conversation

@sfc-gh-ext-simba-lf
Copy link
Collaborator

Description

Allow users to configure ServicePointManager.ConnectionLimit property

Checklist

  • Code compiles correctly
  • Code is formatted according to Coding Conventions
  • Created tests which fail without the change (if possible)
  • All tests passing (dotnet test)
  • Extended the README / documentation, if necessary
  • Provide JIRA issue id (if possible) or GitHub issue id in PR name

@codecov
Copy link

codecov bot commented Aug 20, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3368 1 3367 115
View the full list of 3 ❄️ flaky test(s)
Snowflake.Data.Tests.IntegrationTests.ConnectionPoolCommonIT(MultipleConnectionPool)::TestRollbackTransactionOnPooledWhenExceptionOccurred

Flake rate in main: 55.56% (Passed 4 times, Failed 5 times)

Stack Traces | 2.36s run time
at Snowflake.Data.Tests.IntegrationTests.ConnectionPoolCommonIT.TestRollbackTransactionOnPooledWhenExceptionOccurred() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\IntegrationTests\ConnectionPoolCommonIT.cs:line 161

1)    at Snowflake.Data.Tests.IntegrationTests.ConnectionPoolCommonIT.TestRollbackTransactionOnPooledWhenExceptionOccurred() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\IntegrationTests\ConnectionPoolCommonIT.cs:line 161
Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest::TestScheduledCleanupRemovesExpiredEntries

Flake rate in main: 20.00% (Passed 12 times, Failed 3 times)

Stack Traces | 1.54s run time
at Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest.TestScheduledCleanupRemovesExpiredEntries() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\UnitTests\Revocation\CrlCacheManagerTest.cs:line 127

1)    at Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest.TestScheduledCleanupRemovesExpiredEntries() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\UnitTests\Revocation\CrlCacheManagerTest.cs:line 127
Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest::TestScheduledCleanupRemovesStaleEntries

Flake rate in main: 20.00% (Passed 12 times, Failed 3 times)

Stack Traces | 1.53s run time
at Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest.TestScheduledCleanupRemovesStaleEntries() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\UnitTests\Revocation\CrlCacheManagerTest.cs:line 166

1)    at Snowflake.Data.Tests.UnitTests.Revocation.CrlCacheManagerTest.TestScheduledCleanupRemovesStaleEntries() in D:\a\snowflake-connector-net\snowflake-connector-net\Snowflake.Data.Tests\UnitTests\Revocation\CrlCacheManagerTest.cs:line 166

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@sfc-gh-dszmolka
Copy link
Contributor

when you get there; would it be please possible to also extend the documentation @sfc-gh-ext-simba-lf ? Thank you in advance!

@sfc-gh-ext-simba-lf
Copy link
Collaborator Author

when you get there; would it be please possible to also extend the documentation @sfc-gh-ext-simba-lf ? Thank you in advance!

Sure, I'll update the docs as well

@sfc-gh-ext-simba-lf sfc-gh-ext-simba-lf marked this pull request as ready for review September 5, 2025 17:14
@sfc-gh-ext-simba-lf sfc-gh-ext-simba-lf requested a review from a team as a code owner September 5, 2025 17:14
}

[Test]
public void TestThrowsExceptionWhenSettingConnectionLimitPropertyToNonStringValue()
Copy link
Collaborator

@sfc-gh-mgemra sfc-gh-mgemra Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a string. Maybe TestThrowsExceptionWhenSettingConnectionLimitPropertyToNonNumericValue?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also add other test cases:
"abc", "1.5", "true", etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the test and also added the test cases mentioned above

{
if (_servicePointConnectionLimit < 1)
{
s_logger.Warn($"Connection limit cannot be less than 1. Using the default value of {DefaultConnectionLimit}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
s_logger.Warn($"Connection limit cannot be less than 1. Using the default value of {DefaultConnectionLimit}");
s_logger.Warn($"Connection limit must be a positive integer. Using the default value of {DefaultConnectionLimit}");

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the message to similar to the suggestion above and also mentioned the upper limit


private void ValidateConnectionLimit()
{
if (_servicePointConnectionLimit < 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need an upper limit here?
cc: @sfc-gh-mhofman

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the upper limit should be so it's currently set to 1000

Is there a specific upper limit you would like to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants