{"action":"created","issue":{"url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/222","repository_url":"https://api.github.com/repos/TestStack/TestStack.BDDfy","labels_url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/222/comments","events_url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/222/events","html_url":"https://github.com/TestStack/TestStack.BDDfy/issues/222","id":129994880,"number":222,"title":"TestContext lack of thread-safety breaks tests classes using fluent API running in parallel","user":{"login":"Eldar1205","id":5265591,"avatar_url":"https://avatars.githubusercontent.com/u/5265591?v=3","gravatar_id":"","url":"https://api.github.com/users/Eldar1205","html_url":"https://github.com/Eldar1205","followers_url":"https://api.github.com/users/Eldar1205/followers","following_url":"https://api.github.com/users/Eldar1205/following{/other_user}","gists_url":"https://api.github.com/users/Eldar1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Eldar1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eldar1205/subscriptions","organizations_url":"https://api.github.com/users/Eldar1205/orgs","repos_url":"https://api.github.com/users/Eldar1205/repos","events_url":"https://api.github.com/users/Eldar1205/events{/privacy}","received_events_url":"https://api.github.com/users/Eldar1205/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-01-30T14:55:30Z","updated_at":"2016-03-27T20:26:28Z","closed_at":null,"body":"I tried running xUnit tests with BDDfy's fluent API. When I ran each test class on its own everything worked, but when running several test classes in parallel there were non-deterministic errors coming from TestContext class. I examined the code and saw there is a static mutable dictionary inside the class, accessed without locks. \r\n\r\nPossible solutions:\r\n1. Use ConcurrentDictionary, its semantics are exactly what TestContext needs (preferred, but requires .Net 4 and above)\r\n2. Use locks when accessing the dictionary (.Net 2 and above)"},"comment":{"url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/comments/202140977","html_url":"https://github.com/TestStack/TestStack.BDDfy/issues/222#issuecomment-202140977","issue_url":"https://api.github.com/repos/TestStack/TestStack.BDDfy/issues/222","id":202140977,"user":{"login":"Eldar1205","id":5265591,"avatar_url":"https://avatars.githubusercontent.com/u/5265591?v=3","gravatar_id":"","url":"https://api.github.com/users/Eldar1205","html_url":"https://github.com/Eldar1205","followers_url":"https://api.github.com/users/Eldar1205/followers","following_url":"https://api.github.com/users/Eldar1205/following{/other_user}","gists_url":"https://api.github.com/users/Eldar1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Eldar1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eldar1205/subscriptions","organizations_url":"https://api.github.com/users/Eldar1205/orgs","repos_url":"https://api.github.com/users/Eldar1205/repos","events_url":"https://api.github.com/users/Eldar1205/events{/privacy}","received_events_url":"https://api.github.com/users/Eldar1205/received_events","type":"User","site_admin":false},"created_at":"2016-03-27T20:26:28Z","updated_at":"2016-03-27T20:26:28Z","body":"Hi, thank you very much for fixing this :) \r\n\r\nWhen will a 4.2.1 version be released so this bug fix could reach BDDfy users?"}}