Skip to content

Commit

Permalink
EBP-482: Updated test in response to PR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentDaniel committed Feb 18, 2025
1 parent aa7ff26 commit 63fc7c5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,17 @@ var _ = Describe("Cache Strategy", func() {
Expect(messagingService.Metrics().GetValue(metrics.CacheRequestsSucceeded)).To(BeNumerically("==", 0))
Expect(messagingService.Metrics().GetValue(metrics.CacheRequestsFailed)).To(BeNumerically("==", 0))

var cacheResponse solace.CacheResponse
var cacheResponse1 solace.CacheResponse
cacheName = fmt.Sprintf("MaxMsgs%d", numExpectedCachedMessages)

/* NOTE: Subsequent CachedOnly succeeds. */
cacheRequestConfig = helpers.GetValidCachedOnlyCacheRequestConfig(cacheName, topic)
secondCacheRequestID = message.CacheRequestID(5)
secondCacheRequestID = message.CacheRequestID(4)
secondChannel, err = receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeNil())
Expect(secondChannel).ToNot(BeNil())
Eventually(secondChannel, "10s").Should(Receive(&cacheResponse))
Expect(cacheResponse).ToNot(BeNil())
Eventually(secondChannel, "10s").Should(Receive(&cacheResponse1))
Expect(cacheResponse1).ToNot(BeNil())
/* EBP-25: Assert cache request ID matches cache response ID. */
/* EBP-26: Assert CacheRequestOutcome Ok. */
/* EBP-28: Assert err is nil. */
Expand All @@ -372,13 +372,14 @@ var _ = Describe("Cache Strategy", func() {
Expect(messagingService.Metrics().GetValue(metrics.CacheRequestsFailed)).To(BeNumerically("==", 0))

/* NOTE: Subsequent AsAvailable succeeds. */
var cacheResponse2 solace.CacheResponse
cacheRequestConfig = helpers.GetValidAsAvailableCacheRequestConfig(cacheName, topic)
secondCacheRequestID = message.CacheRequestID(4)
secondCacheRequestID = message.CacheRequestID(5)
secondChannel, err = receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeNil())
Expect(secondChannel).ToNot(BeNil())
Eventually(secondChannel, "10s").Should(Receive(&cacheResponse))
Expect(cacheResponse).ToNot(BeNil())
Eventually(secondChannel, "10s").Should(Receive(&cacheResponse2))
Expect(cacheResponse2).ToNot(BeNil())
/* EBP-25: Assert cache request ID matches cache response ID. */
/* EBP-26: Assert CacheRequestOutcome Ok. */
/* EBP-28: Assert err is nil. */
Expand All @@ -397,8 +398,9 @@ var _ = Describe("Cache Strategy", func() {
Expect(messagingService.Metrics().GetValue(metrics.CacheRequestsFailed)).To(BeNumerically("==", 0))

/* NOTE: First AsAvailable cache request should succeed. */
Eventually(channel, "10s").Should(Receive(&cacheResponse))
Expect(cacheResponse).ToNot(BeNil())
var cacheResponse3 solace.CacheResponse
Eventually(channel, "10s").Should(Receive(&cacheResponse3))
Expect(cacheResponse3).ToNot(BeNil())
/* EBP-25: Assert cache request ID matches cache response ID. */
/* EBP-26: Assert CacheRequestOutcome Ok. */
/* EBP-28: Assert err is nil. */
Expand Down

0 comments on commit 63fc7c5

Please sign in to comment.