Skip to content

Commit

Permalink
Rename test functions, extract error message
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio committed Oct 3, 2022
1 parent 42653bc commit e090573
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions js.go
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ func (sub *Subscription) resetOrderedConsumer(sseq uint64) {
nc.mu.Unlock()

pushErr := func(err error) {
nc.handleConsumerSequenceMismatch(sub, err)
nc.handleConsumerSequenceMismatch(sub, fmt.Errorf("%w: recreating ordered consumer", err))
nc.unsubscribe(sub, 0, true)
}

Expand Down Expand Up @@ -1970,19 +1970,19 @@ func (sub *Subscription) resetOrderedConsumer(sseq uint64) {
// if creating consumer failed, retry
return
}
pushErr(fmt.Errorf("%w: recreating ordered consumer", err))
pushErr(err)
return
}

var cinfo consumerResponse
err = json.Unmarshal(resp.Data, &cinfo)
if err != nil {
pushErr(fmt.Errorf("%w: recreating ordered consumer", err))
pushErr(err)
return
}

if cinfo.Error != nil {
pushErr(fmt.Errorf("%w: recreating ordered consumer", cinfo.Error))
pushErr(cinfo.Error)
return
}

Expand Down
2 changes: 1 addition & 1 deletion js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func TestJetStreamOrderedConsumer(t *testing.T) {
testSyncConsumer()
}

func TestOrderedConsumerDeleteAssets(t *testing.T) {
func TestJetStreamOrderedConsumerDeleteAssets(t *testing.T) {
s := RunBasicJetStreamServer()
defer shutdownJSServerAndRemoveStorage(t, s)

Expand Down
2 changes: 1 addition & 1 deletion test/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8146,7 +8146,7 @@ func TestJetStreamMsgAckShouldErrForConsumerAckNone(t *testing.T) {
}
}

func TestOrderedConsumerRecreateAfterReconnect(t *testing.T) {
func TestJetStreamOrderedConsumerRecreateAfterReconnect(t *testing.T) {
s := RunBasicJetStreamServer()

// monitor for ErrConsumerNotActive error and suppress logging
Expand Down

0 comments on commit e090573

Please sign in to comment.