From 843dff7f69b04bd501dd9e8f6f042b66a38996d5 Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Mon, 19 Aug 2024 10:52:17 -0500 Subject: [PATCH] Bug 36964197 - Build: Intermittent failure in TopicChannelCountRecoveryTests.shouldRecoverCorrectChannelCount (merge main -> ce/main 110686) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 110687] --- .../java/topics/TopicChannelCountRecoveryTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/prj/test/functional/topics/src/main/java/topics/TopicChannelCountRecoveryTests.java b/prj/test/functional/topics/src/main/java/topics/TopicChannelCountRecoveryTests.java index 159479bc122ba..4d7dddadfea60 100644 --- a/prj/test/functional/topics/src/main/java/topics/TopicChannelCountRecoveryTests.java +++ b/prj/test/functional/topics/src/main/java/topics/TopicChannelCountRecoveryTests.java @@ -103,12 +103,25 @@ public void shouldRecoverCorrectChannelCount() throws Exception SubscriberId subscriberId = future.get(5, TimeUnit.MINUTES); assertThat(subscriberId, is(notNullValue())); + // the topic in the subscriber JVM should eventually have the correct channel count + Eventually.assertDeferred(() -> CreateSubscriber.apply(memberSub, subscriberId, Subscriber::getChannelCount), + is(cChannelIncreased)); + + // call receive on the subscriber so that we ensure it is connected and should be allocated all channels + CreateSubscriber.apply(memberSub, subscriberId, sub -> + { + sub.receive(); + return null; + }); + + // The subscriber should be allocated the correct count of channels Eventually.assertDeferred(() -> CreateSubscriber.apply(memberSub, subscriberId, sub -> { int[] anChannel = sub.getChannels(); return anChannel == null ? 0 : anChannel.length; }), is(cChannelIncreased)); + }