Skip to content

Commit

Permalink
Merge pull request #784 from ankon/pr/empty-assignment-spec-flake
Browse files Browse the repository at this point in the history
Only disconnect() the consumer & producers when they were created
  • Loading branch information
Nevon authored Jun 24, 2020
2 parents cc25c1e + 072c87d commit 9ed0787
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/consumer/__tests__/assignerProtocolIntegration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ describe('Consumer > assignerProtocol > integration', () => {
})

afterEach(async () => {
await consumer1.disconnect()
await consumer2.disconnect()
consumer1 && (await consumer1.disconnect())
consumer2 && (await consumer2.disconnect())
})

test('provides member user data', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/consumer/__tests__/connection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer.disconnect()
consumer && (await consumer.disconnect())
})

test('support SSL connections', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/__tests__/consume010MessagesOn011API.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer.disconnect()
await producer.disconnect()
consumer && (await consumer.disconnect())
producer && (await producer.disconnect())
})

testIfKafka_0_11('consume 0.10 messages with 0.11 API', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/__tests__/consumeMessages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer.disconnect()
await producer.disconnect()
consumer && (await consumer.disconnect())
producer && (await producer.disconnect())
})

it('consume messages', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/__tests__/controlBatches.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer.disconnect()
await producer.disconnect()
consumer && (await consumer.disconnect())
producer && (await producer.disconnect())
})

testIfKafka_0_11('forwards empty control batches to eachBatch', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/__tests__/emptyAssignment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer1.disconnect()
await consumer2.disconnect()
consumer1 && (await consumer1.disconnect())
consumer2 && (await consumer2.disconnect())
})

test('can join the group without receiving any assignment', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/__tests__/subscribe.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe('Consumer', () => {
})

afterEach(async () => {
await consumer.disconnect()
await producer.disconnect()
consumer && (await consumer.disconnect())
producer && (await producer.disconnect())
})

describe('when subscribe', () => {
Expand Down

0 comments on commit 9ed0787

Please sign in to comment.