Skip to content

Commit 275fa36

Browse files
Close subscriptions at the end of drain run, increase concurrency
1 parent 9dc62ca commit 275fa36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

projects/client/Unit/src/unit/TestMessagePatternsSubscription.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void Drain()
124124
#pragma warning disable 0168
125125
try
126126
{
127-
for(int i = 0; i < 1000; i++)
127+
for(int i = 0; i < 100; i++)
128128
{
129129
BasicDeliverEventArgs ea = m_subscription.Next();
130130
if(ea != null)
@@ -139,10 +139,12 @@ public void Drain()
139139
} catch (AlreadyClosedException ace)
140140
{
141141
// expected
142+
} finally
143+
{
144+
m_subscription.Close();
142145
}
143146
#pragma warning restore
144147

145-
m_subscription.Close();
146148
}
147149

148150
protected void PostProcess()
@@ -181,7 +183,7 @@ protected void TestConcurrentIterationWithDrainer(bool ack)
181183
PreparedQueue(q);
182184

183185
List<Thread> ts = new List<Thread>();
184-
for (int i = 0; i < 10; i++)
186+
for (int i = 0; i < 50; i++)
185187
{
186188
SubscriptionDrainer drainer = new SubscriptionDrainer(sub, ack);
187189
Thread t = new Thread(drainer.Drain);

0 commit comments

Comments
 (0)