{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments/222931005","pull_request_review_id":161939091,"id":222931005,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjkzMTAwNQ==","diff_hunk":"@@ -746,27 +731,32 @@ public void onBits(ModbusReadRequestBlueprint request, BitArray bits) {\n         modbusManager.registerRegularPoll(task, 150, 0);\n         callbackCalled.await(5, TimeUnit.SECONDS);\n         modbusManager.unregisterRegularPoll(task);\n-        long countAfter = callbackCalled.getCount();\n-\n-        //\n-        // Test poll rate\n-        //\n         long end = System.currentTimeMillis();\n-        int responses = dataReceived.get();\n-        assertTrue(responses > 1);\n+        assertPollDetails(unexpectedCount, dataReceived, start, end, 145, 500);\n+    }\n \n+    /**\n+     *\n+     * @param unexpectedCount number of unexpected callback calls\n+     * @param callbackCalled number of callback calls (including unexpected)\n+     * @param dataReceived number of expected callback calls (onBits or onRegisters)\n+     * @param pollStartMillis poll start time in milliepoch\n+     * @param expectedPollAverageMin average poll period should be at least greater than this\n+     * @param expectedPollAverageMax average poll period less than this\n+     * @throws InterruptedException\n+     */\n+    private void assertPollDetails(AtomicInteger unexpectedCount, AtomicInteger expectedCount, long pollStartMillis,\n+            long pollEndMillis, int expectedPollAverageMin, int expectedPollAverageMax) throws InterruptedException {\n+        int responses = expectedCount.get();\n         assertThat(unexpectedCount.get(), is(equalTo(0)));","path":"addons/io/org.openhab.io.transport.modbus.test/src/test/java/org/openhab/io/transport/modbus/test/SmokeTest.java","position":114,"original_position":114,"commit_id":"def52df1ec6ecc105adf343004f51d8322248480","original_commit_id":"def52df1ec6ecc105adf343004f51d8322248480","user":{"login":"cweitkamp","id":5131747,"node_id":"MDQ6VXNlcjUxMzE3NDc=","avatar_url":"https://avatars0.githubusercontent.com/u/5131747?v=4","gravatar_id":"","url":"https://api.github.com/users/cweitkamp","html_url":"https://github.com/cweitkamp","followers_url":"https://api.github.com/users/cweitkamp/followers","following_url":"https://api.github.com/users/cweitkamp/following{/other_user}","gists_url":"https://api.github.com/users/cweitkamp/gists{/gist_id}","starred_url":"https://api.github.com/users/cweitkamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cweitkamp/subscriptions","organizations_url":"https://api.github.com/users/cweitkamp/orgs","repos_url":"https://api.github.com/users/cweitkamp/repos","events_url":"https://api.github.com/users/cweitkamp/events{/privacy}","received_events_url":"https://api.github.com/users/cweitkamp/received_events","type":"User","site_admin":false},"body":"This is not an OSGi test hence lets use `assertEquals()` here.","created_at":"2018-10-05T08:40:11Z","updated_at":"2018-10-05T08:41:31Z","html_url":"https://github.com/openhab/openhab2-addons/pull/4057#discussion_r222931005","pull_request_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments/222931005"},"html":{"href":"https://github.com/openhab/openhab2-addons/pull/4057#discussion_r222931005"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057","id":219201815,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MjAxODE1","html_url":"https://github.com/openhab/openhab2-addons/pull/4057","diff_url":"https://github.com/openhab/openhab2-addons/pull/4057.diff","patch_url":"https://github.com/openhab/openhab2-addons/pull/4057.patch","issue_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/4057","number":4057,"state":"open","locked":false,"title":"[modbus] Increase robustness in tests and improve assertion error messages","user":{"login":"ssalonen","id":315866,"node_id":"MDQ6VXNlcjMxNTg2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/315866?v=4","gravatar_id":"","url":"https://api.github.com/users/ssalonen","html_url":"https://github.com/ssalonen","followers_url":"https://api.github.com/users/ssalonen/followers","following_url":"https://api.github.com/users/ssalonen/following{/other_user}","gists_url":"https://api.github.com/users/ssalonen/gists{/gist_id}","starred_url":"https://api.github.com/users/ssalonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssalonen/subscriptions","organizations_url":"https://api.github.com/users/ssalonen/orgs","repos_url":"https://api.github.com/users/ssalonen/repos","events_url":"https://api.github.com/users/ssalonen/events{/privacy}","received_events_url":"https://api.github.com/users/ssalonen/received_events","type":"User","site_admin":false},"body":"To decrease susceptibility to CI slowness \r\n- testing with slower poll rate (50 -> 150 ms)\r\n- relaxing assertion limits\r\n\r\nAlso\r\n- improved error message to give out more details\r\n\r\n(Hopefully) resolves #3910 \r\n\r\n\r\n\r\nSigned-off-by: Sami Salonen <ssalonen@gmail.com>\r\n\r\n<!--\r\nThanks for contributing to the openHAB project!\r\nPlease describe the goal and effect of your PR here.\r\nPay attention to the below notes and to *the guidelines* for this repository.\r\nFeel free to delete any comment sections in the template (starting with \"<!--\").\r\n-->\r\n\r\n<!-- TITLE -->\r\n\r\n<!--\r\nPlease provide a PR summary in the *Title* above, according to the following schema:\r\n- If related to one specific addon: Mention the addon shortname in square brackets\r\n  e.g. \"[exec]\", \"[netatmo]\" or \"[tesla]\"\r\n- If the PR is work in progress: Add \"[WIP]\"\r\n- Give a short meaningful description in imperative mood\r\n  e.g. \"Add support for device XYZ\" or \"Fix wrongly handled exception\"\r\n  for a new add-on/binding: \"Initial contribution\"\r\nExamples:\r\n- \"[homematic] Improve communication with weak signal devices\"\r\n- \"[timemachine][WIP] Initial contribution\"\r\n- \"Update contribution guidelines on new signing rules\"\r\n-->\r\n\r\n<!-- DESCRIPTION -->\r\n\r\n<!--\r\nPlease give a few sentences describing the overall goals of the pull request.\r\nGive enough details to make the improvement and changes of the PR understandable\r\nto both developers and tech-savy users.\r\n\r\nPlease keep the following in mind:\r\n- What is the classification of the PR, e.g. Bugfix, Improvement, Novel Addition, ... ?\r\n- Did you describe the PRs motivation and goal?\r\n- Did you provide a link to any prior discussion, e.g. an issue or community forum thread?\r\n- Did you describe new features for the end user?\r\n- Did you describe any noteworthy changes in usage for the end user?\r\n- Was the documentation updated accordingly, e.g. the addon README?\r\n- Does your contribution follow the coding guidelines:\r\n  https://www.openhab.org/docs/developer/development/guidelines.html\r\n- Did you check for any (relevant) issues from the static code analysis:\r\n  https://www.openhab.org/docs/developer/development/bindings.html#static-code-analysis\r\n- Did you sign-off your work:\r\n  https://www.openhab.org/docs/developer/contributing/contributing.html#sign-your-work\r\n-->\r\n\r\n<!-- TESTING -->\r\n\r\n<!--\r\nYour Pull Request will automatically be built and available under the following folder:\r\nhttps://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/\r\n\r\nIt's a good practice to add an URL to your built JAR in this Pull Request description,\r\nso it's easier for the community to test your Add-on.\r\nIf your Pull Request contains a new binding, it will likely take some time\r\nbefore it's reviewed and processed by maintainers.\r\nThat said, consider submitting your Add-on in the Eclipse IoT Marketplace\r\nSee this thread for more info:\r\nhttps://community.openhab.org/t/24491\r\n\r\nDon't forget to submit a thread about your Add-on in the openHAB community:\r\nhttps://community.openhab.org/c/add-ons \r\n-->\r\n","created_at":"2018-09-30T12:05:58Z","updated_at":"2018-10-05T08:41:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2d32c50ce604b7219d2ad3bf9e6176dd047eafc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/4057/comments","statuses_url":"https://api.github.com/repos/openhab/openhab2-addons/statuses/def52df1ec6ecc105adf343004f51d8322248480","head":{"label":"ssalonen:modbus-test-robustness-fixes","ref":"modbus-test-robustness-fixes","sha":"def52df1ec6ecc105adf343004f51d8322248480","user":{"login":"ssalonen","id":315866,"node_id":"MDQ6VXNlcjMxNTg2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/315866?v=4","gravatar_id":"","url":"https://api.github.com/users/ssalonen","html_url":"https://github.com/ssalonen","followers_url":"https://api.github.com/users/ssalonen/followers","following_url":"https://api.github.com/users/ssalonen/following{/other_user}","gists_url":"https://api.github.com/users/ssalonen/gists{/gist_id}","starred_url":"https://api.github.com/users/ssalonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssalonen/subscriptions","organizations_url":"https://api.github.com/users/ssalonen/orgs","repos_url":"https://api.github.com/users/ssalonen/repos","events_url":"https://api.github.com/users/ssalonen/events{/privacy}","received_events_url":"https://api.github.com/users/ssalonen/received_events","type":"User","site_admin":false},"repo":{"id":88195575,"node_id":"MDEwOlJlcG9zaXRvcnk4ODE5NTU3NQ==","name":"openhab2-addons","full_name":"ssalonen/openhab2-addons","private":false,"owner":{"login":"ssalonen","id":315866,"node_id":"MDQ6VXNlcjMxNTg2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/315866?v=4","gravatar_id":"","url":"https://api.github.com/users/ssalonen","html_url":"https://github.com/ssalonen","followers_url":"https://api.github.com/users/ssalonen/followers","following_url":"https://api.github.com/users/ssalonen/following{/other_user}","gists_url":"https://api.github.com/users/ssalonen/gists{/gist_id}","starred_url":"https://api.github.com/users/ssalonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssalonen/subscriptions","organizations_url":"https://api.github.com/users/ssalonen/orgs","repos_url":"https://api.github.com/users/ssalonen/repos","events_url":"https://api.github.com/users/ssalonen/events{/privacy}","received_events_url":"https://api.github.com/users/ssalonen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ssalonen/openhab2-addons","description":"Add-ons for openHAB 2.x","fork":true,"url":"https://api.github.com/repos/ssalonen/openhab2-addons","forks_url":"https://api.github.com/repos/ssalonen/openhab2-addons/forks","keys_url":"https://api.github.com/repos/ssalonen/openhab2-addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ssalonen/openhab2-addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ssalonen/openhab2-addons/teams","hooks_url":"https://api.github.com/repos/ssalonen/openhab2-addons/hooks","issue_events_url":"https://api.github.com/repos/ssalonen/openhab2-addons/issues/events{/number}","events_url":"https://api.github.com/repos/ssalonen/openhab2-addons/events","assignees_url":"https://api.github.com/repos/ssalonen/openhab2-addons/assignees{/user}","branches_url":"https://api.github.com/repos/ssalonen/openhab2-addons/branches{/branch}","tags_url":"https://api.github.com/repos/ssalonen/openhab2-addons/tags","blobs_url":"https://api.github.com/repos/ssalonen/openhab2-addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ssalonen/openhab2-addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ssalonen/openhab2-addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/ssalonen/openhab2-addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ssalonen/openhab2-addons/statuses/{sha}","languages_url":"https://api.github.com/repos/ssalonen/openhab2-addons/languages","stargazers_url":"https://api.github.com/repos/ssalonen/openhab2-addons/stargazers","contributors_url":"https://api.github.com/repos/ssalonen/openhab2-addons/contributors","subscribers_url":"https://api.github.com/repos/ssalonen/openhab2-addons/subscribers","subscription_url":"https://api.github.com/repos/ssalonen/openhab2-addons/subscription","commits_url":"https://api.github.com/repos/ssalonen/openhab2-addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/ssalonen/openhab2-addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/ssalonen/openhab2-addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/ssalonen/openhab2-addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/ssalonen/openhab2-addons/contents/{+path}","compare_url":"https://api.github.com/repos/ssalonen/openhab2-addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ssalonen/openhab2-addons/merges","archive_url":"https://api.github.com/repos/ssalonen/openhab2-addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ssalonen/openhab2-addons/downloads","issues_url":"https://api.github.com/repos/ssalonen/openhab2-addons/issues{/number}","pulls_url":"https://api.github.com/repos/ssalonen/openhab2-addons/pulls{/number}","milestones_url":"https://api.github.com/repos/ssalonen/openhab2-addons/milestones{/number}","notifications_url":"https://api.github.com/repos/ssalonen/openhab2-addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ssalonen/openhab2-addons/labels{/name}","releases_url":"https://api.github.com/repos/ssalonen/openhab2-addons/releases{/id}","deployments_url":"https://api.github.com/repos/ssalonen/openhab2-addons/deployments","created_at":"2017-04-13T18:39:32Z","updated_at":"2017-11-08T11:52:49Z","pushed_at":"2018-10-03T05:02:45Z","git_url":"git://github.com/ssalonen/openhab2-addons.git","ssh_url":"git@github.com:ssalonen/openhab2-addons.git","clone_url":"https://github.com/ssalonen/openhab2-addons.git","svn_url":"https://github.com/ssalonen/openhab2-addons","homepage":"","size":126795,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"epl-1.0","name":"Eclipse Public License 1.0","spdx_id":"EPL-1.0","url":"https://api.github.com/licenses/epl-1.0","node_id":"MDc6TGljZW5zZTc="},"forks":6,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"9ad81eee25cccc8df99407e80fd39efcc968d6ea","user":{"login":"openhab","id":1007353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDczNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":19753195,"node_id":"MDEwOlJlcG9zaXRvcnkxOTc1MzE5NQ==","name":"openhab2-addons","full_name":"openhab/openhab2-addons","private":false,"owner":{"login":"openhab","id":1007353,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMDczNTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1007353?v=4","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openhab/openhab2-addons","description":"Add-ons for openHAB 2.x","fork":false,"url":"https://api.github.com/repos/openhab/openhab2-addons","forks_url":"https://api.github.com/repos/openhab/openhab2-addons/forks","keys_url":"https://api.github.com/repos/openhab/openhab2-addons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab2-addons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab2-addons/teams","hooks_url":"https://api.github.com/repos/openhab/openhab2-addons/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab2-addons/events","assignees_url":"https://api.github.com/repos/openhab/openhab2-addons/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab2-addons/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab2-addons/tags","blobs_url":"https://api.github.com/repos/openhab/openhab2-addons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab2-addons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab2-addons/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab2-addons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab2-addons/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab2-addons/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab2-addons/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab2-addons/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab2-addons/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab2-addons/subscription","commits_url":"https://api.github.com/repos/openhab/openhab2-addons/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab2-addons/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab2-addons/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab2-addons/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab2-addons/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab2-addons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab2-addons/merges","archive_url":"https://api.github.com/repos/openhab/openhab2-addons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab2-addons/downloads","issues_url":"https://api.github.com/repos/openhab/openhab2-addons/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab2-addons/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab2-addons/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab2-addons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab2-addons/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab2-addons/releases{/id}","deployments_url":"https://api.github.com/repos/openhab/openhab2-addons/deployments","created_at":"2014-05-13T19:41:58Z","updated_at":"2018-10-04T10:47:16Z","pushed_at":"2018-10-05T08:16:13Z","git_url":"git://github.com/openhab/openhab2-addons.git","ssh_url":"git@github.com:openhab/openhab2-addons.git","clone_url":"https://github.com/openhab/openhab2-addons.git","svn_url":"https://github.com/openhab/openhab2-addons","homepage":"","size":299624,"stargazers_count":829,"watchers_count":829,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1590,"mirror_url":null,"archived":false,"open_issues_count":460,"license":{"key":"epl-1.0","name":"Eclipse Public License 1.0","spdx_id":"EPL-1.0","url":"https://api.github.com/licenses/epl-1.0","node_id":"MDc6TGljZW5zZTc="},"forks":1590,"open_issues":460,"watchers":829,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057"},"html":{"href":"https://github.com/openhab/openhab2-addons/pull/4057"},"issue":{"href":"https://api.github.com/repos/openhab/openhab2-addons/issues/4057"},"comments":{"href":"https://api.github.com/repos/openhab/openhab2-addons/issues/4057/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab2-addons/pulls/4057/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab2-addons/statuses/def52df1ec6ecc105adf343004f51d8322248480"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cweitkamp"}}