Race condition in test
See original GitHub issueThis seems to be very very rare, found it on Travis today.
$ npm test
> multer@1.0.5 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.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to write tests that check for race conditions?
Race conditions are inherently a result of non-determinism. If you cannot ensure that the calling sequence is secure, then introduce a number of...
Read more >Race condition testing | Rapita Systems
Race conditions occur in multithreaded software when multiple threads attempt to modify a piece of shared data at the same time.
Read more >What is a Race Condition? - TechTarget
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the...
Read more >How do you test and demonstrate that you have properly ...
Sometimes you have some control over the timing, and you can intentionally force a race in a test. When you are using a...
Read more >Data Race Detector - The Go Programming Language
Data races are among the most common and hardest to debug types of bugs in concurrent systems. A data race occurs when two...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I havenβt noticed the CITGM failure mentioned in https://github.com/expressjs/multer/issues/238#issuecomment-540915547 in a long time so Iβd guess that any Node.js part of this is fixed on the master branch at least.
so closing as resolved; we can always re-open if necessary.