Parcourir la source

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

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

GitOrigin-RevId: 6523a4e3f738e1ce8b84ae0f7bd9bacb2abf39c4
Jakob Ackermann il y a 5 ans
Parent
commit
58b8ac3775

+ 3 - 1
services/web/test/acceptance/src/BackFillDeletedFilesTests.js

@@ -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 },