Skip to content

Commit 71c3e9a

Browse files
Improve Subscription test
It depends on a server-sent event and needs better outcome assertion. Also, delete the queue after we set up a callback, it is less confusing.
1 parent 6e83128 commit 71c3e9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,15 @@ public void TestConsumerCancellationNotification()
6666
var q = Guid.NewGuid().ToString();
6767
this.Model.QueueDeclare(queue: q, durable: false, exclusive: false, autoDelete: false, arguments: null);
6868
var sub = new Subscription(this.Model, q);
69-
this.Model.QueueDelete(q);
69+
var latch = new ManualResetEvent(false);
7070
sub.Consumer.ConsumerCancelled += (_sender, _args) =>
7171
{
7272
sub.Close();
73+
latch.Set();
74+
Conn.Close();
7375
};
76+
this.Model.QueueDelete(q);
77+
Wait(latch, TimeSpan.FromSeconds(4));
7478
}
7579
}
7680
}

0 commit comments

Comments
 (0)