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 407df2e
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
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 407df2e

Please sign in to comment.