Skip to content

Commit

Permalink
Merge pull request #103 from SolaceDev/cache_test_stability
Browse files Browse the repository at this point in the history
Cache test stability
  • Loading branch information
TrentDaniel authored Feb 20, 2025
2 parents 81310b4 + e36a07a commit b74f9ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions test/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var _ = Describe("Cache Strategy", func() {
Expect(err).To(BeNil())
err = messagingService.Connect()
Expect(err).To(BeNil())
receiver, err = messagingService.CreateDirectMessageReceiverBuilder().Build()
receiver, err = messagingService.CreateDirectMessageReceiverBuilder().OnBackPressureDropOldest(100100).Build()
Expect(err).To(BeNil())
err = receiver.Start()
Expect(err).To(BeNil())
Expand Down Expand Up @@ -558,12 +558,14 @@ var _ = Describe("Cache Strategy", func() {
/* NOTE: Check the live messages second. */
for i := 0; i < numExpectedLiveMessages; i++ {
var msg message.InboundMessage
Eventually(receivedMsgChan).Should(Receive(&msg), fmt.Sprintf("Timed out waiting to receive message %d of %d", i, numExpectedLiveMessages))
Eventually(receivedMsgChan).Should(Receive(&msg), fmt.Sprintf("Timed out waiting to receive message %d of %d with %d messages dropped from back pressure", i, numExpectedLiveMessages, messagingService.Metrics().GetValue(metrics.ReceivedMessagesBackpressureDiscarded)))
Expect(msg).ToNot(BeNil())
Expect(msg.GetDestinationName()).To(Equal(topic))
id, ok := msg.GetCacheRequestID()
Expect(ok).To(BeFalse())
Expect(id).To(BeNumerically("==", 0))
Expect(msg.GetMessageDiscardNotification().HasBrokerDiscardIndication()).To(BeFalse())
Expect(msg.GetMessageDiscardNotification().HasInternalDiscardIndication()).To(BeFalse())
/* EBP-21: Assert that this is a live message */
}
},
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/cache_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func SendMsgsToTopic(topic string, numMessages int) {
}()
err = receiver.Start()
Expect(err).To(BeNil())
publisher, err := messagingService.CreateDirectMessagePublisherBuilder().OnBackPressureReject(0).Build()
publisher, err := messagingService.CreateDirectMessagePublisherBuilder().Build()
Expect(err).To(BeNil())
defer func() {
err := publisher.Terminate(0)
Expand Down

0 comments on commit b74f9ea

Please sign in to comment.