firebase/quickstart-nodejs

Firestore emulator: clearing databases after performing transactions with no writes

merlinnot opened this issue · 1 comments

@ryanpbrewster @samtstern

After performing a transaction with no writes, a call to clearData takes more than 30 seconds. I suspect that this is a timeout for a transaction.

Reproduction:

Relevant code:

const reference = firestore.collection('collection').doc('doc');

await reference.set({});

await firestore.runTransaction(
  async (transaction: Transaction): Promise<void> => {
    await transaction.get(reference);
  },
);

await clearFirestoreData();

Full reproduction:

Download and unzip:
reproduction.zip

Run:

cd reproduction
npm install
time npx ts-node index.ts

Expected result:

npx ts-node .  6.12s user 0.49s system 19% cpu 33.829 total

Seems likely, let's use firebase/firebase-tools#1624 to track this. Closing this issue as a duplicate.