Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Tests will now verify asynchronous termination of underlying steam, and fix related bug. #1772

Merged
merged 3 commits into from Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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();
ehsannas marked this conversation as resolved.
Show resolved Hide resolved
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