{"action":"opened","issue":{"url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/18","labels_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/18/comments","events_url":"https://api.github.com/repos/thejoshwolfe/yauzl/issues/18/events","html_url":"https://github.com/thejoshwolfe/yauzl/issues/18","id":92491040,"number":18,"title":"race condition in test.js: Error: closed","user":{"login":"thejoshwolfe","id":87436,"avatar_url":"https://avatars.githubusercontent.com/u/87436?v=3","gravatar_id":"","url":"https://api.github.com/users/thejoshwolfe","html_url":"https://github.com/thejoshwolfe","followers_url":"https://api.github.com/users/thejoshwolfe/followers","following_url":"https://api.github.com/users/thejoshwolfe/following{/other_user}","gists_url":"https://api.github.com/users/thejoshwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/thejoshwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejoshwolfe/subscriptions","organizations_url":"https://api.github.com/users/thejoshwolfe/orgs","repos_url":"https://api.github.com/users/thejoshwolfe/repos","events_url":"https://api.github.com/users/thejoshwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/thejoshwolfe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-01T21:39:49Z","updated_at":"2015-07-01T21:39:49Z","closed_at":null,"body":"After some amount of normal test output:\r\n\r\n```\r\n/home/josh/dev/yauzl/test/test.js:78\r\n                if (err) throw err;\r\n                               ^\r\nError: closed\r\n    at ZipFile.openReadStream (/home/josh/dev/yauzl/index.js:262:37)\r\n    at /home/josh/dev/yauzl/test/test.js:77:23\r\n    at pendGo (/home/josh/dev/yauzl/node_modules/pend/index.js:54:3)\r\n    at onCb (/home/josh/dev/yauzl/node_modules/pend/index.js:41:7)\r\n    at AssertByteCountStream.<anonymous> (/home/josh/dev/yauzl/test/test.js:91:19)\r\n    at AssertByteCountStream.emit (events.js:129:20)\r\n    at _stream_readable.js:908:16\r\n    at process._tickCallback (node.js:355:11)\r\nnpm ERR! Test failed.  See above for more details.\r\n```\r\n\r\nThe problem seems to be that we are deferring `openReadStream` until after `entityProcessing.go` lets us start. Since we're using yauzl's `autoClose: true`, we're missing the window of time when we can call `openReadStream`."}}