Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 774e9e5

Browse files
authoredSep 26, 2022
fix: flakey test testGetTopology_returnCachedTopology (#164)
`testGetTopology_returnCachedTopology` is flaky because when it calls `getTopology` `refreshNeeded(topology)` will always true. This method always return true because it checks if the elapsed time has exceeded `refreshRateInMilliseconds`, which is initialized to 0, so the elapsed time will always be greater.
1 parent 861e93c commit 774e9e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/AuroraHostListProvider.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ public class AuroraHostListProvider implements HostListProvider, DynamicHostList
9797
private RdsUrlType rdsUrlType;
9898
private final RdsUtils rdsHelper;
9999

100-
private int refreshRateInMilliseconds;
100+
private int refreshRateInMilliseconds = Integer.parseInt(
101+
CLUSTER_TOPOLOGY_REFRESH_RATE_MS.defaultValue != null
102+
? CLUSTER_TOPOLOGY_REFRESH_RATE_MS.defaultValue
103+
: "30000");
101104
private List<HostSpec> hostList = new ArrayList<>();
102105
private List<HostSpec> lastReturnedHostList;
103106
private List<HostSpec> initialHostList = new ArrayList<>();

0 commit comments

Comments
 (0)
Please sign in to comment.