Skip to content

Commit 6e17e18

Browse files
committed
fix: integration tests
1 parent b5c60a8 commit 6e17e18

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

aws_advanced_python_wrapper/aurora_connection_tracker_plugin.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,6 @@ def populate_opened_connection_set(self, host_info: HostInfo, conn: Connection):
4949
:param conn: currently opened connection.
5050
"""
5151

52-
# // Check if the connection was established using an instance endpoint
53-
# if (rdsUtils.isRdsInstance(hostSpec.getHost())) {
54-
# trackConnection(hostSpec.getHostAndPort(), conn);
55-
# return;
56-
# }
57-
#
58-
# final String instanceEndpoint = aliases.stream()
59-
# .filter(x -> rdsUtils.isRdsInstance(rdsUtils.removePort(x)))
60-
# .max(String::compareToIgnoreCase)
61-
# .orElse(null);
62-
#
63-
# if (instanceEndpoint == null) {
64-
# LOGGER.finest(
65-
# Messages.get("OpenedConnectionTracker.unableToPopulateOpenedConnectionQueue",
66-
# new Object[] {hostSpec.getHost()}));
67-
# return;
68-
# }
69-
7052
aliases: FrozenSet[str] = host_info.as_aliases()
7153

7254
if self._rds_utils.is_rds_instance(host_info.host):
@@ -99,7 +81,7 @@ def invalidate_all_connections(self, host_info: Optional[HostInfo] = None, host:
9981
return
10082

10183
for instance in host:
102-
if instance is not None and self._rds_utils.is_rds_instance(instance):
84+
if instance is not None and self._rds_utils.is_rds_instance(self._rds_utils.remove_port(instance)):
10385
instance_endpoint = instance
10486
break
10587

tests/integration/container/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from aws_advanced_python_wrapper.host_list_provider import RdsHostListProvider
2929
from aws_advanced_python_wrapper.plugin_service import PluginServiceImpl
3030
from aws_advanced_python_wrapper.utils.log import Logger
31+
from aws_advanced_python_wrapper.utils.rdsutils import RdsUtils
3132

3233
if TYPE_CHECKING:
3334
from .utils.test_driver import TestDriver
@@ -124,6 +125,7 @@ def pytest_runtest_setup(item):
124125

125126
assert cluster_ip == writer_ip
126127

128+
RdsUtils.clear_cache()
127129
RdsHostListProvider._topology_cache.clear()
128130
RdsHostListProvider._is_primary_cluster_id_cache.clear()
129131
RdsHostListProvider._cluster_ids_to_update.clear()

tests/integration/container/test_read_write_splitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ def test_pooled_connection__failover_failed(
516516
self, test_environment: TestEnvironment, test_driver: TestDriver,
517517
rds_utils, conn_utils, proxied_failover_props):
518518
writer_host = test_environment.get_writer().get_host()
519-
provider = SqlAlchemyPooledConnectionProvider(lambda _, __: {"pool_size": 1}, lambda host_info, props: writer_host in host_info.host)
519+
provider = SqlAlchemyPooledConnectionProvider(lambda _, __: {"pool_size": 1}, None, lambda host_info, props: writer_host in host_info.host)
520520
ConnectionProviderManager.set_connection_provider(provider)
521521

522522
WrapperProperties.PLUGINS.set(proxied_failover_props, "read_write_splitting,failover,host_monitoring")

0 commit comments

Comments
 (0)