{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3985","repository_url":"https://api.github.com/repos/ReactiveX/RxJava","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3985/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3985/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3985/events","html_url":"https://github.com/ReactiveX/RxJava/issues/3985","id":158289942,"number":3985,"title":"Proposal: Make Schedulers should be more friendly to tests","user":{"login":"hzsweers","id":1361086,"avatar_url":"https://avatars.githubusercontent.com/u/1361086?v=3","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ReactiveX/RxJava/labels/Feature-Request","name":"Feature-Request","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-03T04:41:27Z","updated_at":"2016-06-03T05:55:34Z","closed_at":null,"body":"`RxJavaPlugins.reset()` was recently made public, but there was a common misconception that this would also reset schedulers. This isn't the case however since Schedulers permanently cache their resolved schedulers, so `RxJavaPlugins.reset()` actually doesn't help in this regard. \r\n\r\nI'd like to propose adding a `Schedulers.reset()` function as well. It comes with same caveats that `RxJavaPlugins.reset()` has in that it's dangerous to call in live code, but it would be enormously helpful in testing. This would simply null out the cached schedulers to force a re-check the next time they're used, and thus letting you change the scheduling hook and have the new one's output propagate. \r\n\r\nWith JUnit, it could be nicely wrapped up in a rule that could be optionally dropped into test suites on the fly. Otherwise, schedulers must be set at the beginning of your whole test suite and delegate schedulers put in place that can be configured later.\r\n\r\nIf people would be open to this, I'd be happy to provide a PR. I looked for prior discussion around this but wasn't able to find any. If I missed them somewhere, please let me know."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/223496915","html_url":"https://github.com/ReactiveX/RxJava/issues/3985#issuecomment-223496915","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3985","id":223496915,"user":{"login":"hzsweers","id":1361086,"avatar_url":"https://avatars.githubusercontent.com/u/1361086?v=3","gravatar_id":"","url":"https://api.github.com/users/hzsweers","html_url":"https://github.com/hzsweers","followers_url":"https://api.github.com/users/hzsweers/followers","following_url":"https://api.github.com/users/hzsweers/following{/other_user}","gists_url":"https://api.github.com/users/hzsweers/gists{/gist_id}","starred_url":"https://api.github.com/users/hzsweers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzsweers/subscriptions","organizations_url":"https://api.github.com/users/hzsweers/orgs","repos_url":"https://api.github.com/users/hzsweers/repos","events_url":"https://api.github.com/users/hzsweers/events{/privacy}","received_events_url":"https://api.github.com/users/hzsweers/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T05:55:34Z","updated_at":"2016-06-03T05:55:34Z","body":"Opened a PR in #3986 for further review"}}
{"actor":{"display_login":"hzsweers"}}