{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/978","repository_url":"https://api.github.com/repos/cucumber/cucumber-jvm","labels_url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/978/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/978/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/978/events","html_url":"https://github.com/cucumber/cucumber-jvm/pull/978","id":144395987,"number":978,"title":"Double-check for directory exists in the ensureParentDirExists(File)","user":{"login":"niberius","id":2945490,"avatar_url":"https://avatars.githubusercontent.com/u/2945490?v=3","gravatar_id":"","url":"https://api.github.com/users/niberius","html_url":"https://github.com/niberius","followers_url":"https://api.github.com/users/niberius/followers","following_url":"https://api.github.com/users/niberius/following{/other_user}","gists_url":"https://api.github.com/users/niberius/gists{/gist_id}","starred_url":"https://api.github.com/users/niberius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niberius/subscriptions","organizations_url":"https://api.github.com/users/niberius/orgs","repos_url":"https://api.github.com/users/niberius/repos","events_url":"https://api.github.com/users/niberius/events{/privacy}","received_events_url":"https://api.github.com/users/niberius/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-29T21:37:59Z","updated_at":"2016-05-12T15:56:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cucumber/cucumber-jvm/pulls/978","html_url":"https://github.com/cucumber/cucumber-jvm/pull/978","diff_url":"https://github.com/cucumber/cucumber-jvm/pull/978.diff","patch_url":"https://github.com/cucumber/cucumber-jvm/pull/978.patch"},"body":"Hi.\r\n\r\nI have several JUnit runners which runs cucumber tests in parallel at the same time. Each runner generate JSON file with test results to the one directory, e.g. ./target/json-files/\r\n```\r\n@CucumberOptions(\r\n        plugin = {\"json:target/json-files/Test1.json\"}, ...)\r\n```\r\nSometimes I have an issue when one of runner is unable to create reports directory because another runner already done this. And it fails with error \"Failed to create directory\".\r\nI think there is a make sense to double-check if reports directory is already exists (method cucumber.runtime.io.URLOutputStream#ensureParentDirExists)."},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/comments/218802240","html_url":"https://github.com/cucumber/cucumber-jvm/pull/978#issuecomment-218802240","issue_url":"https://api.github.com/repos/cucumber/cucumber-jvm/issues/978","id":218802240,"user":{"login":"niberius","id":2945490,"avatar_url":"https://avatars.githubusercontent.com/u/2945490?v=3","gravatar_id":"","url":"https://api.github.com/users/niberius","html_url":"https://github.com/niberius","followers_url":"https://api.github.com/users/niberius/followers","following_url":"https://api.github.com/users/niberius/following{/other_user}","gists_url":"https://api.github.com/users/niberius/gists{/gist_id}","starred_url":"https://api.github.com/users/niberius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niberius/subscriptions","organizations_url":"https://api.github.com/users/niberius/orgs","repos_url":"https://api.github.com/users/niberius/repos","events_url":"https://api.github.com/users/niberius/events{/privacy}","received_events_url":"https://api.github.com/users/niberius/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T15:56:43Z","updated_at":"2016-05-12T15:56:43Z","body":"I did it. Could you please review my test? If you run it without my changes in URLOutputStream, you'll get many \"Failed to create parent directory\" errors. But another assertion in my test which verifies that all necessary temp files and theirs parents are created will be passed.\r\nI spent an hours to emulate my situation in test. Please, note that this is an intermittent issue and in my real project it reproduces ~2 times for 10 runs. For temporarily fix, I've put URLOutputStream with my changes to my project with the same package name and cucumber getting my modified class from class path. Issue is not appears in that case but in my point of view, this is an unreliable solution and \"bicycle\". Some fixes should be made inside cucumber. Maybe my, maybe you own, as you wish...\r\nThank you in advance."}}