Skip to content

Remove "can write very large batches" test. #1510

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 1 commit into from
Feb 1, 2019
Merged
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
42 changes: 0 additions & 42 deletions packages/firestore/test/integration/api/batch_writes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import * as firestore from '@firebase/firestore-types';
import { expect } from 'chai';
import { AutoId } from '../../../src/util/misc';

import { EventsAccumulator } from '../util/events_accumulator';
import firebase from '../util/firebase_export';
Expand Down Expand Up @@ -350,45 +349,4 @@ apiDescribe('Database batch writes', persistence => {
});
});
});

it('can write very large batches', () => {
// On Android, SQLite Cursors are limited reading no more than 2 MB per row
// (despite being able to write very large values). This test verifies that
// the local MutationQueue is not subject to this limitation.

// Create a map containing nearly 1 MB of data. Note that if you use 1024
// below this will create a document larger than 1 MB, which will be
// rejected by the backend as too large.
let kb = 'a';
while (kb.length < 1000) {
kb += kb;
}
kb = kb.substr(0, 1000);
const values = {};
for (let i = 0; i < 1000; i++) {
values[AutoId.newId()] = kb;
}

return integrationHelpers.withTestCollection(
persistence,
{},
async collection => {
const doc = collection.doc('a');
const batch = doc.firestore.batch();

// Write a batch containing 3 copies of the data, creating a ~3 MB
// batch. Writing to the same document in a batch is allowed and so long
// as the net size of the document is under 1 MB the batch is allowed.
batch.set(doc, values);
for (let i = 0; i < 2; i++) {
batch.update(doc, values);
}

await batch.commit();

const snap = await doc.get();
expect(snap.data()).to.deep.equal(values);
}
);
});
});