{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/5234","repository_url":"https://api.github.com/repos/ReactiveX/RxJava","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/5234/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/5234/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/5234/events","html_url":"https://github.com/ReactiveX/RxJava/issues/5234","id":217106677,"node_id":"MDU6SXNzdWUyMTcxMDY2Nzc=","number":5234,"title":"2.x: Uncaught errors fail silently in junit tests.","user":{"login":"hzsweers","id":1361086,"node_id":"MDQ6VXNlcjEzNjEwODY=","avatar_url":"https://avatars1.githubusercontent.com/u/1361086?v=4","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":[{"id":480313802,"node_id":"MDU6TGFiZWw0ODAzMTM4MDI=","url":"https://api.github.com/repos/ReactiveX/RxJava/labels/2.x","name":"2.x","color":"af40af","default":false},{"id":24234455,"node_id":"MDU6TGFiZWwyNDIzNDQ1NQ==","url":"https://api.github.com/repos/ReactiveX/RxJava/labels/Question","name":"Question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2017-03-27T00:34:59Z","updated_at":"2018-11-08T17:31:32Z","closed_at":"2018-05-27T00:00:58Z","author_association":"CONTRIBUTOR","body":"I was writing a utility that involved decorating observers and catching uncaught errors from the delegate observer's `onError` handling when I noticed in testing that tests always passed. There would be log output, but tests would pass none the less.\r\n\r\nDemo of the issue can be found [here](https://github.com/hzsweers/RxJava/blob/6bf9afcf4c6b14dc25b9b5aa766b75750239b365/src/test/java/io/reactivex/JUnitErrorTest.java), but the gist of it is that the following test passes in standard JUnit:\r\n\r\n```java\r\n@Test\r\npublic void blerg() {\r\n    Observable.error(new RuntimeException(\"This should fail the test\"))\r\n            .subscribe();\r\n}\r\n```\r\n\r\nI'm trying to understand why errors are passed directly to the handler rather than just thrown, and also curious to get thoughts on making this behavior configurable (if for no other reason than to disable in junit tests). I can't find any details about why this behavior happens in JUnit either.\r\n\r\nI think this has worrisome implications. In our codebase alone, I dropped in an error watching [rule](https://github.com/uber/AutoDispose/blob/master/autodispose/src/test/java/com/uber/autodispose/RxErrorsRule.java) to track these and discovered over 150 tests with uncaught exceptions that are being marked as passing otherwise."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments/437087698","html_url":"https://github.com/ReactiveX/RxJava/issues/5234#issuecomment-437087698","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/5234","id":437087698,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzA4NzY5OA==","user":{"login":"JorgeCastilloPrz","id":6547526,"node_id":"MDQ6VXNlcjY1NDc1MjY=","avatar_url":"https://avatars1.githubusercontent.com/u/6547526?v=4","gravatar_id":"","url":"https://api.github.com/users/JorgeCastilloPrz","html_url":"https://github.com/JorgeCastilloPrz","followers_url":"https://api.github.com/users/JorgeCastilloPrz/followers","following_url":"https://api.github.com/users/JorgeCastilloPrz/following{/other_user}","gists_url":"https://api.github.com/users/JorgeCastilloPrz/gists{/gist_id}","starred_url":"https://api.github.com/users/JorgeCastilloPrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorgeCastilloPrz/subscriptions","organizations_url":"https://api.github.com/users/JorgeCastilloPrz/orgs","repos_url":"https://api.github.com/users/JorgeCastilloPrz/repos","events_url":"https://api.github.com/users/JorgeCastilloPrz/events{/privacy}","received_events_url":"https://api.github.com/users/JorgeCastilloPrz/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T17:31:32Z","updated_at":"2018-11-08T17:31:32Z","author_association":"NONE","body":"Thanks for the Rule, @hzsweers. Not super cool to use something like this, but no choice. It's something."}}
{"actor":{"display_login":"JorgeCastilloPrz"}}