Skip to content

Commit

Permalink
SOL-62456: Fixed problems from bad PR merge. Refer to pull 102 for de…
Browse files Browse the repository at this point in the history
…tails.
  • Loading branch information
TrentDaniel committed Feb 19, 2025
1 parent a533d12 commit 81310b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ var _ = Describe("Cache Strategy", func() {
numExpectedCachedMessages := 3
cacheName := fmt.Sprintf("MaxMsgs%d/delay=5000", numExpectedCachedMessages)
topic := fmt.Sprintf("MaxMsgs%d/%s/data1", numExpectedCachedMessages, testcontext.Cache().Vpn)
cacheRequestConfig := resource.NewCachedMessageSubscriptionRequest(resource.LiveCancelsCached, cacheName, resource.TopicSubscriptionOf(topic), int32(7000), int32(0), int32(0))
cacheRequestConfig := resource.NewCachedMessageSubscriptionRequest(resource.CacheRequestStrategyLiveCancelsCached, cacheName, resource.TopicSubscriptionOf(topic), int32(7000), int32(0), int32(0))
receivedMsgChan := make(chan message.InboundMessage, numExpectedCachedMessages)
receiver.ReceiveAsync(func(msg message.InboundMessage) {
receivedMsgChan <- msg
Expand All @@ -586,31 +586,31 @@ var _ = Describe("Cache Strategy", func() {
cacheName = fmt.Sprintf("MaxMsgs%d", numExpectedCachedMessages)

/* NOTE: Subsequent LiveCancelsCached fails. */
cacheRequestConfig = helpers.GetValidLiveCancelsCachedRequestConfig(cacheName, topic)
cacheRequestConfig = helpers.GetValidCacheRequestStrategyLiveCancelsCachedRequestConfig(cacheName, topic)
secondCacheRequestID := message.CacheRequestID(2)
secondChannel, err := receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeAssignableToTypeOf(&solace.NativeError{}))
helpers.ValidateNativeError(err, subcode.CacheAlreadyInProgress)
Expect(secondChannel).To(BeNil())

/* NOTE: Subsequent AsAvailable fails. */
cacheRequestConfig = helpers.GetValidAsAvailableCacheRequestConfig(cacheName, topic)
cacheRequestConfig = helpers.GetValidCacheRequestStrategyAsAvailableCacheRequestConfig(cacheName, topic)
secondCacheRequestID = message.CacheRequestID(3)
secondChannel, err = receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeAssignableToTypeOf(&solace.NativeError{}))
helpers.ValidateNativeError(err, subcode.CacheAlreadyInProgress)
Expect(secondChannel).To(BeNil())

/* NOTE: Subsequent CachedFirst fails. */
cacheRequestConfig = helpers.GetValidCachedFirstCacheRequestConfig(cacheName, topic)
cacheRequestConfig = helpers.GetValidCacheRequestStrategyCachedFirstCacheRequestConfig(cacheName, topic)
secondCacheRequestID = message.CacheRequestID(4)
secondChannel, err = receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeAssignableToTypeOf(&solace.NativeError{}))
helpers.ValidateNativeError(err, subcode.CacheAlreadyInProgress)
Expect(secondChannel).To(BeNil())

/* NOTE: Subsequent CachedOnly fails. */
cacheRequestConfig = helpers.GetValidCachedOnlyCacheRequestConfig(cacheName, topic)
cacheRequestConfig = helpers.GetValidCacheRequestStrategyCachedOnlyCacheRequestConfig(cacheName, topic)
secondCacheRequestID = message.CacheRequestID(5)
secondChannel, err = receiver.RequestCachedAsync(cacheRequestConfig, secondCacheRequestID)
Expect(err).To(BeAssignableToTypeOf(&solace.NativeError{}))
Expand Down

0 comments on commit 81310b4

Please sign in to comment.