{"action":"opened","issue":{"url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/88","repository_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul","labels_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/88/comments","events_url":"https://api.github.com/repos/SBoudrias/gulp-istanbul/issues/88/events","html_url":"https://github.com/SBoudrias/gulp-istanbul/issues/88","id":145409328,"number":88,"title":"gulp-istanbul loads files with persistent connections","user":{"login":"moxious","id":5471710,"avatar_url":"https://avatars.githubusercontent.com/u/5471710?v=3","gravatar_id":"","url":"https://api.github.com/users/moxious","html_url":"https://github.com/moxious","followers_url":"https://api.github.com/users/moxious/followers","following_url":"https://api.github.com/users/moxious/following{/other_user}","gists_url":"https://api.github.com/users/moxious/gists{/gist_id}","starred_url":"https://api.github.com/users/moxious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxious/subscriptions","organizations_url":"https://api.github.com/users/moxious/orgs","repos_url":"https://api.github.com/users/moxious/repos","events_url":"https://api.github.com/users/moxious/events{/privacy}","received_events_url":"https://api.github.com/users/moxious/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-02T19:45:59Z","updated_at":"2016-04-02T19:45:59Z","closed_at":null,"body":"In gulpfile.js, I have a setup that looks like this:\r\n\r\n```\r\n    return gulp.src(config.sourceCode)\r\n        .pipe(istanbul({ includeUntested: true }))\r\n        .pipe(istanbul.hookRequire());\r\n```\r\n\r\nAn issue I'm running into is that some of my modules may need to create and maintain long-running connections (e.g. to a database); these modules provide shutdown methods, but istanbul seems to be requiring or using the modules in a way that is in parallel to the rest of my testing process; shutdown is being called within the test, but istanbul seems to have a separate copy open, is this possible?   At the end of the test routine, gulp simply hangs, owing to those modules keeping open connections.\r\n\r\nNow, I can avoid this by omitting modules that behave this way from the `gulp.src` but then I have to give up test coverage metrics on those files, which I'd rather not.  \r\n\r\nAny suggestions on what istanbul is doing here that would be keeping these modules open?"}}