Skip to content

Commit

Permalink
[Event Hubs] fixes flaky EventProcessor test (#4574)
Browse files Browse the repository at this point in the history
  • Loading branch information
chradek authored Jul 31, 2019
1 parent b108b22 commit 5384df1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sdk/eventhub/event-hubs/test/eventProcessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe("Event Processor", function(): void {
}

// set a delay to give a consumers a chance to receive a message
await delay(1000);
await delay(3000);

// shutdown the processor
await processor.stop();
Expand All @@ -230,17 +230,15 @@ describe("Event Processor", function(): void {
processor.start();

// set a delay to give a consumers a chance to receive a message
await delay(1000);
await delay(3000);

await processor.stop();

didError.should.be.false;
// validate correct events captured for each partition
// validate that partitionProcessor methods were called
// do not check events until checkpointing is implemented
for (const partitionId of partitionIds) {
const results = partitionResultsMap.get(partitionId)!;
const events = results.events;
events.length.should.equal(1);
events[0].should.equal(expectedMessagePrefix + partitionId);
results.initialized.should.be.true;
(results.closeReason === CloseReason.Shutdown).should.be.true;
}
Expand Down Expand Up @@ -437,7 +435,9 @@ describe("Event Processor", function(): void {
});

describe("InMemory Partition Manager", function(): void {
it("should claim ownership, get a list of ownership and update checkpoint", async function(): Promise<void> {
it("should claim ownership, get a list of ownership and update checkpoint", async function(): Promise<
void
> {
const inMemoryPartitionManager = new InMemoryPartitionManager();
const partitionOwnership1: PartitionOwnership = {
eventHubName: "myEventHub",
Expand All @@ -458,13 +458,13 @@ describe("Event Processor", function(): void {
partitionOwnership2
]);
partitionOwnership.length.should.equals(2);

const ownershipslist = await inMemoryPartitionManager.listOwnerships(
"myEventHub",
EventHubClient.defaultConsumerGroupName
);
ownershipslist.length.should.equals(2);

const checkpoint: Checkpoint = {
eventHubName: "myEventHub",
consumerGroupName: EventHubClient.defaultConsumerGroupName,
Expand Down

0 comments on commit 5384df1

Please sign in to comment.