Skip to content

Race condition in test #238

Closed
Closed
@LinusU

Description

@LinusU

This seems to be very very rare, found it on Travis today.

$ npm test

> [email protected] test /home/travis/build/expressjs/multer
> standard && mocha



  Disk Storage
    ✓ should process parser/form-data POST request
    1) should process empty fields and an empty file
    ✓ should process multiple files
    ✓ should remove uploaded files on error
    ✓ should report error when directory doesn't exist

  Error Handling
    ✓ should respect parts limit
    ✓ should respect file size limit
    ✓ should respect file count limit
    ✓ should respect file key limit
    ✓ should respect field key limit
    ✓ should respect field value limit
    ✓ should respect field count limit
    ✓ should respect fields given
    ✓ should report errors from storage engines
    ✓ should report errors from busboy constructor
    ✓ should report errors from busboy parsing

  Expected files
    ✓ should reject single unexpected file
    ✓ should reject array of multiple files
    ✓ should reject overflowing arrays
    ✓ should accept files with expected fieldname
    ✓ should reject files with unexpected fieldname

  Express Integration
    ✓ should work with express error handling (42ms)
    ✓ should work when receiving error from fileFilter

  Fields
    ✓ should process multiple fields
    ✓ should process empty fields
    ✓ should not process non-multipart POST request
    ✓ should not process non-multipart GET request
    ✓ should handle basic keys
    ✓ should handle multiple values
    ✓ should handle deeper structure
    ✓ should handle sparse arrays
    ✓ should handle even deeper
    ✓ should handle such deep
    ✓ should handle merge behaviour
    ✓ should handle bad fields
    ✓ should convert arrays into objects

  File Filter
    ✓ should skip some files
    ✓ should report errors from fileFilter

  File ordering
    ✓ should present files in same order as they came

  Functionality
    ✓ should upload the file to the `dest` dir
    ✓ should rename the uploaded file
    ✓ should ensure all req.files values (single-file per field) point to an array
    ✓ should ensure all req.files values (multi-files per field) point to an array
    ✓ should rename the destination directory to a different directory

  Issue #232
    ✓ should report limit errors

  Memory Storage
    ✓ should process multipart/form-data POST request
    ✓ should process empty fields and an empty file
    ✓ should process multiple files

  Reuse Middleware
    ✓ should accept multiple requests (48ms)

  Select Field
    ✓ should select the first file with fieldname
    ✓ should select all files with fieldname

  Unicode
    ✓ should handle unicode filenames


  51 passing (412ms)
  1 failing

  1) Disk Storage should process empty fields and an empty file:
     Uncaught Error: ENOENT: no such file or directory, stat '/tmp/gvQUuo2Ne54/154080e1a19a860bba7db8c648f4358f'
      at Error (native)
      at Object.fs.statSync (fs.js:849:18)
      at Object.fileSize (test/_util.js:11:13)
      at test/disk-storage.js:81:25
      at Immediate.<anonymous> (test/_util.js:32:37)



npm ERR! Test failed.  See above for more details.

The command "npm test" exited with 1.

Done. Your build exited with 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions