Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
fixes #215 onReady and onConnectionError tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwulf committed Oct 24, 2023
1 parent 38abf47 commit 9809fd9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _New shiny stuff._
_Things that were broken and are now fixed._

- An error message "Grpc Stream Error: 16 UNAUTHENTICATED: Failed to parse bearer token, see cause for details" would be logged intermittently. This was because under particular conditions an expired token cached on disk could be used for API calls. To prevent this, the disk-cached token is evicted at the same time as the in-memory token. See [#336](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/336) for more details.
- The `onReady` and `onConnection` event tests now pass, so these events should be usable. See [#215](https://github.com/camunda-community-hub/zeebe-client-node-js/issues/215) for more details.

# Version 8.2.5

Expand Down
5 changes: 2 additions & 3 deletions src/__tests__/integration/Worker-onReady.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ZBClient } from '../..'
jest.setTimeout(40000)
process.env.ZEEBE_NODE_LOG_LEVEL = process.env.ZEEBE_NODE_LOG_LEVEL || 'NONE'

// Currently broken. See #215
xtest(`Worker calls the onReady handler once if there is a broker`, done => {
test(`Worker calls the onReady handler once if there is a broker`, done => {
let called = 0
const zbc2 = new ZBClient()
zbc2.createWorker({
Expand Down Expand Up @@ -74,7 +73,7 @@ test(`Does not call the onReady handler if there is no broker`, done => {
}, 5000)
})

xtest(`Does not emit the ready event if there is no broker`, done => {
test(`Does not emit the ready event if there is no broker`, done => {
let called = 0
const zbc2 = new ZBClient('nobroker')
zbc2.createWorker({
Expand Down
9 changes: 3 additions & 6 deletions src/__tests__/local-integration/OnConnectionError.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ test(`Calls the onConnectionError handler if there is no broker and eagerConnect
}, 5000)
}))

// Currently broken. See #215
xtest(`Does not call the onConnectionError handler if there is a broker`, () =>
test(`Does not call the onConnectionError handler if there is a broker`, () =>
new Promise(done => {
let calledB = 0
const zbc2 = new ZBClient({
Expand All @@ -44,8 +43,7 @@ xtest(`Does not call the onConnectionError handler if there is a broker`, () =>
}, 5000)
}))

// Currently broken. See #215
xtest(`Calls ZBClient onConnectionError once when there is no broker, eagerConnection:true, and workers with no handler`, () =>
test(`Calls ZBClient onConnectionError once when there is no broker, eagerConnection:true, and workers with no handler`, () =>
new Promise(done => {
let calledC = 0
const zbc2 = new ZBClient('localtoast:234532534', {
Expand Down Expand Up @@ -125,8 +123,7 @@ test(`Trailing parameter worker onConnectionError handler API works`, () =>
}, 10000)
}))

// Currently broken. See #215
xtest(`Does not call the onConnectionError handler if there is a business error`, () =>
test(`Does not call the onConnectionError handler if there is a business error`, () =>
new Promise(async done => {
let calledF = 0
let wf = 'arstsrasrateiuhrastulyharsntharsie'
Expand Down

0 comments on commit 9809fd9

Please sign in to comment.