Skip to content

Commit

Permalink
Bug 37106624 - Build: Intermittent failure in TopicSubscribeCleanupTe…
Browse files Browse the repository at this point in the history
…sts.shouldCloseSubscribersOnMemberDeparture - harden test

(merge main -> ce/main 111672)

[git-p4: depot-paths = "//dev/coherence-ce/main/": change = 111673]
  • Loading branch information
thegridman committed Sep 30, 2024
1 parent d27c3b7 commit 28a2b34
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
Expand Down Expand Up @@ -41,6 +41,8 @@
import org.junit.Test;
import org.junit.rules.TestName;

import java.util.concurrent.TimeUnit;

import static com.tangosol.net.topic.Subscriber.Name.inGroup;

import static org.hamcrest.CoreMatchers.is;
Expand All @@ -58,7 +60,7 @@
public class TopicSubscribeCleanupTests
{
@BeforeClass
public static void setup()
public static void setup() throws Exception
{
System.setProperty(LocalStorage.PROPERTY, "true");
System.setProperty(Logging.PROPERTY_LEVEL, "9");
Expand All @@ -68,7 +70,7 @@ public static void setup()
System.setProperty("coherence.cluster", "TopicSubscribeCleanupTests");

s_coherence = Coherence.clusterMember();
s_coherence.start().join();
s_coherence.start().get(5, TimeUnit.MINUTES);
s_session = s_coherence.getSession();
}

Expand Down Expand Up @@ -126,6 +128,9 @@ public void shouldCloseSubscribersOnMemberDeparture() throws Exception
int cChannel = topic.getChannelCount();
try (Subscriber<String> subscriberOne = topic.createSubscriber(inGroup("group-one")))
{
// call receive so we reconnect if disconnected
subscriberOne.receive();

// there is currently one subscribe that should have all channels
Eventually.assertDeferred(() -> subscriberOne.getChannels().length, is(cChannel));
Eventually.assertDeferred(() -> caches.Subscribers.size(), is(1));
Expand Down

0 comments on commit 28a2b34

Please sign in to comment.