Skip to content

Commit

Permalink
Fix tests with termination of underlying steam
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersen committed Sep 14, 2022
1 parent 6393fe7 commit d709194
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 68 deletions.
4 changes: 3 additions & 1 deletion dev/src/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,9 @@ export class Query<T = firestore.DocumentData> implements firestore.Query<T> {
if (proto.done) {
logger('Query._stream', tag, 'Trigger Logical Termination.');
backendStream.unpipe(stream);
stream.emit('end');
backendStream.resume();
backendStream.end();
stream.end();
}
} else {
callback(undefined, {readTime});
Expand Down
4 changes: 2 additions & 2 deletions dev/test/bulk-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ describe('BulkWriter', () => {
});
}

afterEach(() => {
verifyInstance(firestore);
afterEach(async () => {
await verifyInstance(firestore);
setTimeoutHandler(setTimeout);
});

Expand Down
4 changes: 2 additions & 2 deletions dev/test/partition-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ describe('Partition Query', () => {
});
});

afterEach(() => {
verifyInstance(firestore);
afterEach(async () => {
await verifyInstance(firestore);
setTimeoutHandler(setTimeout);
});

Expand Down
Loading

0 comments on commit d709194

Please sign in to comment.