Skip to content

Fix and skip flaky Firestore tests #7552

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

Merged
merged 3 commits into from
Aug 14, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/firestore/test/integration/api/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,11 @@ apiDescribe('Database', persistence => {
.then(snap => {
expect(snap.exists()).to.be.true;
expect(snap.data()).to.deep.equal({ a: 1 });
expect(snap.metadata.hasPendingWrites).to.be.false;
})
.then(() => storeEvent.assertNoAdditionalEvents());
// This event could be a metadata change for fromCache as well.
// We comment this line out to reduce flakiness.
// TODO(b/295872012): Figure out a way to check for all scenarios.
// expect(snap.metadata.hasPendingWrites).to.be.false;
});
});
});

Expand All @@ -827,9 +829,11 @@ apiDescribe('Database', persistence => {
.then(() => storeEvent.awaitEvent())
.then(snap => {
expect(snap.data()).to.deep.equal(changedData);
expect(snap.metadata.hasPendingWrites).to.be.false;
})
.then(() => storeEvent.assertNoAdditionalEvents());
// This event could be a metadata change for fromCache as well.
// We comment this line out to reduce flakiness.
// TODO(b/295872012): Figure out a way to check for all scenarios.
// expect(snap.metadata.hasPendingWrites).to.be.false;
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ apiDescribe('Numeric Transforms:', persistence => {
});
});

it('increment existing integer with integer', async () => {
// TODO(b/295872012): This test is skipped due to a timeout test flakiness
// We should investigate if this is an acutal bug.
// eslint-disable-next-line no-restricted-properties
it.skip('increment existing integer with integer', async () => {
await withTestSetup(async () => {
await writeInitialData({ sum: 1337 });
await updateDoc(docRef, 'sum', increment(1));
Expand Down Expand Up @@ -158,7 +161,11 @@ apiDescribe('Numeric Transforms:', persistence => {
});
});

it('multiple double increments', async () => {
// TODO(b/295872012): This test is skipped due to test flakiness:
// AssertionError: expected 0.122 to be close to 0.111 +/- 0.000001
// We should investigate the root cause, it might be an acutal bug.
// eslint-disable-next-line no-restricted-properties
it.skip('multiple double increments', async () => {
await withTestSetup(async () => {
await writeInitialData({ sum: 0.0 });

Expand Down
6 changes: 5 additions & 1 deletion packages/firestore/test/integration/api/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,11 @@ apiDescribe('Queries', persistence => {
});
});

it('can listen for the same query with different options', () => {
// TODO(b/295872012): This test is skipped due to the flakiness around the
// checks of hasPendingWrites.
// We should investigate if this is an acutal bug.
// eslint-disable-next-line no-restricted-properties
it.skip('can listen for the same query with different options', () => {
const testDocs = { a: { v: 'a' }, b: { v: 'b' } };
return withTestCollection(persistence, testDocs, coll => {
const storeEvent = new EventsAccumulator<QuerySnapshot>();
Expand Down