[BackFillDeletedFilesTests] fix flaky assertion -- sort db entries (#3674)

The projects are processed in parallel, so the entries are potentially
 not sorted.

GitOrigin-RevId: 6523a4e3f738e1ce8b84ae0f7bd9bacb2abf39c4
This commit is contained in:
Jakob Ackermann 2021-02-17 13:56:48 +00:00 committed by Copybot
parent 2051caf28e
commit 58b8ac3775

View file

@ -86,7 +86,9 @@ describe('BackFillDeletedFiles', function() {
function checkAreFilesBackFilled() {
it('should back fill file and set projectId', async function() {
const docs = await db.deletedFiles.find({}).toArray()
const docs = await db.deletedFiles
.find({}, { sort: { _id: 1 } })
.toArray()
expect(docs).to.deep.equal([
{ _id: fileId1, projectId: projectId1, ...otherFileDetails },
{ _id: fileId2, projectId: projectId1, ...otherFileDetails },