@@ -125,3 +125,85 @@ class TestRedisBigSegmentStore(BigSegmentStoreTestBase):
125125 @property
126126 def tester_class (self ):
127127 return RedisBigSegmentStoreTester
128+
129+
130+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
131+ def test_feature_store_max_connections_is_not_used ():
132+ """Test that the max_connections parameter is NOT passed to the Redis connection pool."""
133+ custom_max_connections = 42
134+ store = Redis .new_feature_store (max_connections = custom_max_connections )
135+
136+ # Access the connection pool through the wrapper's core
137+ actual_max_connections = store ._core ._pool .max_connections
138+
139+ # Should NOT be our custom value since the parameter is unused
140+ assert actual_max_connections != custom_max_connections , \
141+ f"Expected max_connections to NOT be { custom_max_connections } , but it was set"
142+
143+
144+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
145+ def test_big_segment_store_max_connections_is_not_used ():
146+ """Test that the max_connections parameter is NOT passed to the Redis connection pool."""
147+ custom_max_connections = 42
148+ store = Redis .new_big_segment_store (max_connections = custom_max_connections )
149+
150+ # Access the connection pool directly from the store
151+ actual_max_connections = store ._pool .max_connections
152+
153+ # Should NOT be our custom value since the parameter is unused
154+ assert actual_max_connections != custom_max_connections , \
155+ f"Expected max_connections to NOT be { custom_max_connections } , but it was set"
156+
157+
158+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
159+ def test_feature_store_max_connections_warns_when_non_default (caplog ):
160+ """Test that a warning is logged when max_connections differs from the default."""
161+ import logging
162+ caplog .set_level (logging .WARNING )
163+
164+ custom_max_connections = 42
165+ Redis .new_feature_store (max_connections = custom_max_connections )
166+
167+ assert any ("max_connections parameter is not used" in record .message for record in caplog .records ), \
168+ "Expected warning that parameter is not used"
169+ assert any ("redis_opts" in record .message for record in caplog .records ), \
170+ "Expected warning to mention redis_opts"
171+
172+
173+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
174+ def test_big_segment_store_max_connections_warns_when_non_default (caplog ):
175+ """Test that a warning is logged when max_connections differs from the default."""
176+ import logging
177+ caplog .set_level (logging .WARNING )
178+
179+ custom_max_connections = 42
180+ Redis .new_big_segment_store (max_connections = custom_max_connections )
181+
182+ assert any ("max_connections parameter is not used" in record .message for record in caplog .records ), \
183+ "Expected warning that parameter is not used"
184+ assert any ("redis_opts" in record .message for record in caplog .records ), \
185+ "Expected warning to mention redis_opts"
186+
187+
188+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
189+ def test_feature_store_max_connections_no_warn_when_default (caplog ):
190+ """Test that no warning is logged when max_connections is the default value."""
191+ import logging
192+ caplog .set_level (logging .WARNING )
193+
194+ Redis .new_feature_store (max_connections = Redis .DEFAULT_MAX_CONNECTIONS )
195+
196+ assert not any ("max_connections parameter is not used" in record .message for record in caplog .records ), \
197+ "Expected no warning when using default value"
198+
199+
200+ @pytest .mark .skipif (skip_database_tests , reason = "skipping database tests" )
201+ def test_big_segment_store_max_connections_no_warn_when_default (caplog ):
202+ """Test that no warning is logged when max_connections is the default value."""
203+ import logging
204+ caplog .set_level (logging .WARNING )
205+
206+ Redis .new_big_segment_store (max_connections = Redis .DEFAULT_MAX_CONNECTIONS )
207+
208+ assert not any ("max_connections parameter is not used" in record .message for record in caplog .records ), \
209+ "Expected no warning when using default value"
0 commit comments