File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,9 @@ type QueueSuite struct {
5959suite.Suite
6060r rand.Rand
6161
62- TxNotSupported bool
63- BrokerURI string
62+ TxNotSupported bool
63+ AdvWindowNotSupported bool
64+ BrokerURI string
6465
6566Broker Broker
6667}
@@ -136,10 +137,17 @@ func (s *QueueSuite) TestJob_Reject_no_requeue() {
136137err = j .Reject (false )
137138assert .NoError (err )
138139
139- done := s .checkNextClosed (iter )
140- <- time .After (50 * time .Millisecond )
141- assert .NoError (iter .Close ())
142- <- done
140+ if s .AdvWindowNotSupported {
141+ j , err := iter .Next ()
142+ assert .Nil (j )
143+ assert .NoError (err )
144+ assert .NoError (iter .Close ())
145+ } else {
146+ done := s .checkNextClosed (iter )
147+ <- time .After (50 * time .Millisecond )
148+ assert .NoError (iter .Close ())
149+ <- done
150+ }
143151}
144152
145153func (s * QueueSuite ) TestJob_Reject_requeue () {
@@ -395,10 +403,17 @@ func (s *QueueSuite) TestTransaction_Error() {
395403advertisedWindow := 1
396404i , err := q .Consume (advertisedWindow )
397405assert .NoError (err )
398- done := s .checkNextClosed (i )
399- <- time .After (50 * time .Millisecond )
400- assert .NoError (i .Close ())
401- <- done
406+ if s .AdvWindowNotSupported {
407+ j , err := i .Next ()
408+ assert .Nil (j )
409+ assert .NoError (err )
410+ assert .NoError (i .Close ())
411+ } else {
412+ done := s .checkNextClosed (i )
413+ <- time .After (50 * time .Millisecond )
414+ assert .NoError (i .Close ())
415+ <- done
416+ }
402417}
403418
404419func (s * QueueSuite ) TestTransaction () {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ type MemorySuite struct {
1717
1818func (s * MemorySuite ) SetupSuite () {
1919s .BrokerURI = testMemoryURI
20+ s .AdvWindowNotSupported = true
2021}
2122
2223func (s * MemorySuite ) TestIntegration () {
You can’t perform that action at this time.
0 commit comments