File tree 1 file changed +4
-2
lines changed
src/test/java/io/lettuce/core/cluster
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -718,15 +718,17 @@ public void clear() {
718
718
@ Test
719
719
void shouldCancelTopologyRefreshTaskOnShutdown () {
720
720
ClusterTopologyRefreshOptions refreshOptions = ClusterTopologyRefreshOptions .builder ()
721
- .enablePeriodicRefresh (Duration .ofSeconds ( 1 )).build ();
721
+ .enablePeriodicRefresh (Duration .ofMillis ( 200 )).build ();
722
722
RedisClusterClient clusterClient = RedisClusterClient .create (TestClientResources .get (),
723
723
RedisURI .Builder .redis (TestSettings .host (), ClusterTestSettings .port1 ).build ());
724
+
724
725
clusterClient .setOptions (ClusterClientOptions .builder ().topologyRefreshOptions (refreshOptions ).build ());
725
726
clusterClient .connect ().sync ();
726
727
Delay .delay (Duration .ofMillis (1500 ));
727
- assertThat (clusterClient . isTopologyRefreshInProgress ( )).isTrue ();
728
+ Wait . untilTrue (clusterClient :: isTopologyRefreshInProgress ). during ( Duration . ofSeconds ( 5 )).waitOrTimeout ();
728
729
729
730
clusterClient .shutdownAsync (0 , 10 , TimeUnit .SECONDS ).join ();
731
+ Wait .untilTrue (() -> !clusterClient .isTopologyRefreshInProgress ()).during (Duration .ofSeconds (5 )).waitOrTimeout ();
730
732
731
733
assertThat (clusterClient .isTopologyRefreshInProgress ()).isFalse ();
732
734
FastShutdown .shutdown (clusterClient );
You can’t perform that action at this time.
0 commit comments