Skip to content

Commit

Permalink
fix: Tests will now verify asynchronous termination of underlying ste…
Browse files Browse the repository at this point in the history
…am, and fix related bug. (#1772)

* fix: Tests with termination of underlying steam

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
tom-andersen and gcf-owl-bot[bot] committed Sep 15, 2022
1 parent 282ac8a commit a1717ff
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 70 deletions.
4 changes: 3 additions & 1 deletion dev/src/reference.ts
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
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
Expand Up @@ -86,8 +86,8 @@ describe('Partition Query', () => {
});
});

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

Expand Down

0 comments on commit a1717ff

Please sign in to comment.