Skip to content
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

[WIP] test: express integration #173

Merged
merged 2 commits into from
Aug 6, 2015
Merged

[WIP] test: express integration #173

merged 2 commits into from
Aug 6, 2015

Conversation

LinusU
Copy link
Member

@LinusU LinusU commented Jul 22, 2015

Trying to track down the bug in #168

To run tests from this branch:

git clone https://github.com/expressjs/multer.git
cd multer
git checkout express-integration-test
npm install
npm test

@LinusU
Copy link
Member Author

LinusU commented Jul 22, 2015

Okay so I actually managed to get the test to fail. Turns out that it only happens when the file is large enough to get chunked up, and I had to actually wait for the finish event on the request to see that it failed.

I still don't know how to fix it thought 😕 I thought it would be to add req.resume() in done, but it apparently wasn't that easy...

@vmartis
Copy link

vmartis commented Jul 23, 2015

Hi,

9 tests fail in my environment:

  1. Disk Storage should process parser/form-data POST request:
  Uncaught AssertionError: 1803 == 1778
  + expected - actual

  -1803
  +1778

  at c:\tmp\mutler\multer\test\disk-storage.js:44:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at c:\tmp\mutler\multer\lib\make-middleware.js:141:11
  at WriteStream.<anonymous> (c:\tmp\mutler\multer\storage\disk.js:43:9)
  at finishMaybe (_stream_writable.js:484:14)
  at afterWrite (_stream_writable.js:362:3)
  at onwrite (_stream_writable.js:352:7)
  at WritableState.onwrite (_stream_writable.js:105:5)
  at fs.js:1799:5
  at FSReqWrap.strWrapper (fs.js:568:5)
  1. Disk Storage should process multiple files:
  Uncaught AssertionError: 128 == 122
  + expected - actual

  -128
  +122

  at c:\tmp\mutler\multer\test\disk-storage.js:120:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at Busboy.<anonymous> (c:\tmp\mutler\multer\lib\make-middleware.js:153:7)
  1. Express Integration should work with express error handling:
    Uncaught Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)

  2. Functionality should upload the file to the dest dir:

  Uncaught AssertionError: 1803 == 1778
  + expected - actual

  -1803
  +1778

  at c:\tmp\mutler\multer\test\functionality.js:55:16
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at c:\tmp\mutler\multer\lib\make-middleware.js:141:11
  at WriteStream.<anonymous> (c:\tmp\mutler\multer\storage\disk.js:43:9)
  at finishMaybe (_stream_writable.js:484:14)
  at afterWrite (_stream_writable.js:362:3)
  at onwrite (_stream_writable.js:352:7)
  at WritableState.onwrite (_stream_writable.js:105:5)
  at fs.js:1799:5
  at FSReqWrap.strWrapper (fs.js:568:5)
  1. Functionality should rename the destination directory to a different directory:
  Uncaught AssertionError: false == true
  + expected - actual

  -false
  +true

  at c:\tmp\mutler\multer\test\functionality.js:132:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at c:\tmp\mutler\multer\lib\make-middleware.js:141:11
  at WriteStream.<anonymous> (c:\tmp\mutler\multer\storage\disk.js:43:9)
  at finishMaybe (_stream_writable.js:484:14)
  at afterWrite (_stream_writable.js:362:3)
  at onwrite (_stream_writable.js:352:7)
  at WritableState.onwrite (_stream_writable.js:105:5)
  at fs.js:1799:5
  at FSReqWrap.strWrapper (fs.js:568:5)
  1. Memory Storage should process multipart/form-data POST request:
  Uncaught AssertionError: 1803 == 1778
  + expected - actual

  -1803
  +1778

  at c:\tmp\mutler\multer\test\memory-storage.js:31:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at Busboy.<anonymous> (c:\tmp\mutler\multer\lib\make-middleware.js:153:7)
  1. Memory Storage should process multiple files:
  Uncaught AssertionError: 128 == 122
  + expected - actual

  -128
  +122

  at c:\tmp\mutler\multer\test\memory-storage.js:107:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at Busboy.<anonymous> (c:\tmp\mutler\multer\lib\make-middleware.js:153:7)
  1. Reuse Middleware should accept multiple requests:
  Uncaught AssertionError: 1803 == 1778
  + expected - actual

  -1803
  +1778

  at c:\tmp\mutler\multer\test\reuse-middleware.js:40:18
  at Array.forEach (native)
  at c:\tmp\mutler\multer\test\reuse-middleware.js:37:19
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at Busboy.<anonymous> (c:\tmp\mutler\multer\lib\make-middleware.js:153:7)
  1. Unicode should handle unicode filenames:
  Uncaught AssertionError: 1803 == 1778
  + expected - actual

  -1803
  +1778

  at c:\tmp\mutler\multer\test\unicode.js:50:14
  at c:\tmp\mutler\multer\test\_util.js:26:7
  at done (c:\tmp\mutler\multer\lib\make-middleware.js:41:7)
  at indicateDone (c:\tmp\mutler\multer\lib\make-middleware.js:45:51)
  at c:\tmp\mutler\multer\lib\make-middleware.js:141:11
  at WriteStream.<anonymous> (c:\tmp\mutler\multer\storage\disk.js:43:9)
  at finishMaybe (_stream_writable.js:484:14)
  at afterWrite (_stream_writable.js:362:3)
  at onwrite (_stream_writable.js:352:7)
  at WritableState.onwrite (_stream_writable.js:105:5)
  at fs.js:1799:5
  at FSReqWrap.strWrapper (fs.js:568:5)

@LinusU
Copy link
Member Author

LinusU commented Aug 6, 2015

We're all good!

Debugging this was a pain! 🐛 🔫

@LinusU LinusU merged commit dfa2095 into master Aug 6, 2015
@LinusU LinusU deleted the express-integration-test branch August 6, 2015 19:10
@hacksparrow
Copy link
Member

👏👍🏻

@LinusU
Copy link
Member Author

LinusU commented Aug 7, 2015

I think that this actually was because of a bug in Node.js, and I just managed to work around it a bit. There is still problem thought as shown by #192.

See nodejs/node-v0.x-archive#25823 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants