{"action":"created","comment":{"url":"https://api.github.com/repos/rchain/rchain/pulls/comments/220165142","pull_request_review_id":158507086,"id":220165142,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDE2NTE0Mg==","diff_hunk":"@@ -0,0 +1,40 @@\n+from contextlib import contextmanager\n+from tools.wait import wait_for, has_peers, node_started\n+import logging\n+from tools.rnode import create_peer_nodes\n+\n+\n+class RChain:\n+    def __init__(self, network, bootstrap, peers):\n+        self.network = network\n+        self.bootstrap = bootstrap\n+        self.peers = peers\n+        self.nodes = [bootstrap] + peers\n+\n+\n+@contextmanager\n+def start_network(config, docker, bootstrap, validators_data, allowed_peers=None):\n+    logging.debug(f\"Docker network = {bootstrap.network}\")\n+\n+    bonds_file, _, peer_keys = validators_data\n+    peers = create_peer_nodes(docker, bootstrap, bootstrap.network, bonds_file, peer_keys, config.rnode_timeout, allowed_peers)\n+\n+    yield RChain(network = bootstrap.network, bootstrap = bootstrap, peers = peers)\n+\n+    for peer in peers:\n+        peer.cleanup()\n+\n+\n+def wait_for_started_network(node_startup_timeout, network):\n+    for peer in network.peers:\n+        wait_for(node_started(peer), node_startup_timeout, f\"Peer {peer.name} did not start correctly.\")","path":"integration-testing/src/tools/network.py","position":30,"original_position":30,"commit_id":"c7f91e06d3be77a9cdec40c8ba034e1adb0f847e","original_commit_id":"c7f91e06d3be77a9cdec40c8ba034e1adb0f847e","user":{"login":"adaszko","id":165678,"node_id":"MDQ6VXNlcjE2NTY3OA==","avatar_url":"https://avatars0.githubusercontent.com/u/165678?v=4","gravatar_id":"","url":"https://api.github.com/users/adaszko","html_url":"https://github.com/adaszko","followers_url":"https://api.github.com/users/adaszko/followers","following_url":"https://api.github.com/users/adaszko/following{/other_user}","gists_url":"https://api.github.com/users/adaszko/gists{/gist_id}","starred_url":"https://api.github.com/users/adaszko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adaszko/subscriptions","organizations_url":"https://api.github.com/users/adaszko/orgs","repos_url":"https://api.github.com/users/adaszko/repos","events_url":"https://api.github.com/users/adaszko/events{/privacy}","received_events_url":"https://api.github.com/users/adaszko/received_events","type":"User","site_admin":false},"body":"What you're saying is crystal clear.  The problem is with debugging such a code.  A test will fail eventually.  When it fails, the stack trace should ideally tell the expectation that failed.  With `wait_for()` the stack trace will be deeper, names more cryptic and the reason for failing more obscure.  Trust me, let's not take this path.","created_at":"2018-09-25T12:09:15Z","updated_at":"2018-09-25T12:09:15Z","html_url":"https://github.com/rchain/rchain/pull/1552#discussion_r220165142","pull_request_url":"https://api.github.com/repos/rchain/rchain/pulls/1552","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments/220165142"},"html":{"href":"https://github.com/rchain/rchain/pull/1552#discussion_r220165142"},"pull_request":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1552"}},"in_reply_to_id":220114079},"pull_request":{"url":"https://api.github.com/repos/rchain/rchain/pulls/1552","id":217825293,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3ODI1Mjkz","html_url":"https://github.com/rchain/rchain/pull/1552","diff_url":"https://github.com/rchain/rchain/pull/1552.diff","patch_url":"https://github.com/rchain/rchain/pull/1552.patch","issue_url":"https://api.github.com/repos/rchain/rchain/issues/1552","number":1552,"state":"open","locked":false,"title":"Refactor tests","user":{"login":"odeac","id":1412609,"node_id":"MDQ6VXNlcjE0MTI2MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1412609?v=4","gravatar_id":"","url":"https://api.github.com/users/odeac","html_url":"https://github.com/odeac","followers_url":"https://api.github.com/users/odeac/followers","following_url":"https://api.github.com/users/odeac/following{/other_user}","gists_url":"https://api.github.com/users/odeac/gists{/gist_id}","starred_url":"https://api.github.com/users/odeac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odeac/subscriptions","organizations_url":"https://api.github.com/users/odeac/orgs","repos_url":"https://api.github.com/users/odeac/repos","events_url":"https://api.github.com/users/odeac/events{/privacy}","received_events_url":"https://api.github.com/users/odeac/received_events","type":"User","site_admin":false},"body":"## Overview\r\nSimplify integration tests\r\n\r\n### Which JIRA issue does this PR relate to? If there is not a JIRA issue addressing this work, please create one now and add the link here.\r\nhttps://rchain.atlassian.net/browse/RHOL-770\r\n\r\n### Complete this checklist before you submit the PR\r\n- [x] This PR contains no more than 200 lines of code, excluding test code.\r\n- [x] This PR meets [RChain development coding standards](https://rchain.atlassian.net/wiki/spaces/DOC/pages/28082177/Coding+Standards).\r\n- [ ] You assigned one person to review this PR\r\n\r\n### If you are not a member of the core development team, please confirm:\r\n- [ ] You signed the commit. Merging requires a signature. Please see the [developer wiki](https://rchain.atlassian.net/wiki/spaces/DOC/pages/498630673/How+to+sign+commits+to+rchain+rchain) for instructions.\r\n- [ ] Your GitHub account is also an account with [Travis CI](https://travis-ci.org). Unit tests will not run on your PR unless you have an account with Travis. Merge requires passed unit tests.\r\n\r\n### Notes\r\nOptional. Add any notes on caveats, approaches you tried that didn't work, or anything else.\r\n","created_at":"2018-09-25T00:33:03Z","updated_at":"2018-09-25T12:09:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"781f2e864d285c508a8cdd3568bff676223d4584","assignee":null,"assignees":[],"requested_reviewers":[{"login":"woky","id":620147,"node_id":"MDQ6VXNlcjYyMDE0Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/620147?v=4","gravatar_id":"","url":"https://api.github.com/users/woky","html_url":"https://github.com/woky","followers_url":"https://api.github.com/users/woky/followers","following_url":"https://api.github.com/users/woky/following{/other_user}","gists_url":"https://api.github.com/users/woky/gists{/gist_id}","starred_url":"https://api.github.com/users/woky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woky/subscriptions","organizations_url":"https://api.github.com/users/woky/orgs","repos_url":"https://api.github.com/users/woky/repos","events_url":"https://api.github.com/users/woky/events{/privacy}","received_events_url":"https://api.github.com/users/woky/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rchain/rchain/pulls/1552/commits","review_comments_url":"https://api.github.com/repos/rchain/rchain/pulls/1552/comments","review_comment_url":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rchain/rchain/issues/1552/comments","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/c7f91e06d3be77a9cdec40c8ba034e1adb0f847e","head":{"label":"odeac:refactor-tests","ref":"refactor-tests","sha":"c7f91e06d3be77a9cdec40c8ba034e1adb0f847e","user":{"login":"odeac","id":1412609,"node_id":"MDQ6VXNlcjE0MTI2MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1412609?v=4","gravatar_id":"","url":"https://api.github.com/users/odeac","html_url":"https://github.com/odeac","followers_url":"https://api.github.com/users/odeac/followers","following_url":"https://api.github.com/users/odeac/following{/other_user}","gists_url":"https://api.github.com/users/odeac/gists{/gist_id}","starred_url":"https://api.github.com/users/odeac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odeac/subscriptions","organizations_url":"https://api.github.com/users/odeac/orgs","repos_url":"https://api.github.com/users/odeac/repos","events_url":"https://api.github.com/users/odeac/events{/privacy}","received_events_url":"https://api.github.com/users/odeac/received_events","type":"User","site_admin":false},"repo":{"id":135245214,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUyNDUyMTQ=","name":"rchain","full_name":"odeac/rchain","private":false,"owner":{"login":"odeac","id":1412609,"node_id":"MDQ6VXNlcjE0MTI2MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1412609?v=4","gravatar_id":"","url":"https://api.github.com/users/odeac","html_url":"https://github.com/odeac","followers_url":"https://api.github.com/users/odeac/followers","following_url":"https://api.github.com/users/odeac/following{/other_user}","gists_url":"https://api.github.com/users/odeac/gists{/gist_id}","starred_url":"https://api.github.com/users/odeac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odeac/subscriptions","organizations_url":"https://api.github.com/users/odeac/orgs","repos_url":"https://api.github.com/users/odeac/repos","events_url":"https://api.github.com/users/odeac/events{/privacy}","received_events_url":"https://api.github.com/users/odeac/received_events","type":"User","site_admin":false},"html_url":"https://github.com/odeac/rchain","description":null,"fork":true,"url":"https://api.github.com/repos/odeac/rchain","forks_url":"https://api.github.com/repos/odeac/rchain/forks","keys_url":"https://api.github.com/repos/odeac/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odeac/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odeac/rchain/teams","hooks_url":"https://api.github.com/repos/odeac/rchain/hooks","issue_events_url":"https://api.github.com/repos/odeac/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/odeac/rchain/events","assignees_url":"https://api.github.com/repos/odeac/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/odeac/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/odeac/rchain/tags","blobs_url":"https://api.github.com/repos/odeac/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odeac/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odeac/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/odeac/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odeac/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/odeac/rchain/languages","stargazers_url":"https://api.github.com/repos/odeac/rchain/stargazers","contributors_url":"https://api.github.com/repos/odeac/rchain/contributors","subscribers_url":"https://api.github.com/repos/odeac/rchain/subscribers","subscription_url":"https://api.github.com/repos/odeac/rchain/subscription","commits_url":"https://api.github.com/repos/odeac/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/odeac/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/odeac/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/odeac/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/odeac/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/odeac/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odeac/rchain/merges","archive_url":"https://api.github.com/repos/odeac/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odeac/rchain/downloads","issues_url":"https://api.github.com/repos/odeac/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/odeac/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/odeac/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/odeac/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odeac/rchain/labels{/name}","releases_url":"https://api.github.com/repos/odeac/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/odeac/rchain/deployments","created_at":"2018-05-29T05:27:29Z","updated_at":"2018-05-29T05:27:33Z","pushed_at":"2018-09-25T00:38:36Z","git_url":"git://github.com/odeac/rchain.git","ssh_url":"git@github.com:odeac/rchain.git","clone_url":"https://github.com/odeac/rchain.git","svn_url":"https://github.com/odeac/rchain","homepage":null,"size":16793,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rchain:dev","ref":"dev","sha":"a61dce6c1bd56881f377da4a64c5a33251cccae7","user":{"login":"rchain","id":20671765,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjcxNzY1","avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"repo":{"id":84493691,"node_id":"MDEwOlJlcG9zaXRvcnk4NDQ5MzY5MQ==","name":"rchain","full_name":"rchain/rchain","private":false,"owner":{"login":"rchain","id":20671765,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjcxNzY1","avatar_url":"https://avatars0.githubusercontent.com/u/20671765?v=4","gravatar_id":"","url":"https://api.github.com/users/rchain","html_url":"https://github.com/rchain","followers_url":"https://api.github.com/users/rchain/followers","following_url":"https://api.github.com/users/rchain/following{/other_user}","gists_url":"https://api.github.com/users/rchain/gists{/gist_id}","starred_url":"https://api.github.com/users/rchain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rchain/subscriptions","organizations_url":"https://api.github.com/users/rchain/orgs","repos_url":"https://api.github.com/users/rchain/repos","events_url":"https://api.github.com/users/rchain/events{/privacy}","received_events_url":"https://api.github.com/users/rchain/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/rchain/rchain","description":null,"fork":false,"url":"https://api.github.com/repos/rchain/rchain","forks_url":"https://api.github.com/repos/rchain/rchain/forks","keys_url":"https://api.github.com/repos/rchain/rchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rchain/rchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rchain/rchain/teams","hooks_url":"https://api.github.com/repos/rchain/rchain/hooks","issue_events_url":"https://api.github.com/repos/rchain/rchain/issues/events{/number}","events_url":"https://api.github.com/repos/rchain/rchain/events","assignees_url":"https://api.github.com/repos/rchain/rchain/assignees{/user}","branches_url":"https://api.github.com/repos/rchain/rchain/branches{/branch}","tags_url":"https://api.github.com/repos/rchain/rchain/tags","blobs_url":"https://api.github.com/repos/rchain/rchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rchain/rchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rchain/rchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/rchain/rchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rchain/rchain/statuses/{sha}","languages_url":"https://api.github.com/repos/rchain/rchain/languages","stargazers_url":"https://api.github.com/repos/rchain/rchain/stargazers","contributors_url":"https://api.github.com/repos/rchain/rchain/contributors","subscribers_url":"https://api.github.com/repos/rchain/rchain/subscribers","subscription_url":"https://api.github.com/repos/rchain/rchain/subscription","commits_url":"https://api.github.com/repos/rchain/rchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/rchain/rchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/rchain/rchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/rchain/rchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/rchain/rchain/contents/{+path}","compare_url":"https://api.github.com/repos/rchain/rchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rchain/rchain/merges","archive_url":"https://api.github.com/repos/rchain/rchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rchain/rchain/downloads","issues_url":"https://api.github.com/repos/rchain/rchain/issues{/number}","pulls_url":"https://api.github.com/repos/rchain/rchain/pulls{/number}","milestones_url":"https://api.github.com/repos/rchain/rchain/milestones{/number}","notifications_url":"https://api.github.com/repos/rchain/rchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rchain/rchain/labels{/name}","releases_url":"https://api.github.com/repos/rchain/rchain/releases{/id}","deployments_url":"https://api.github.com/repos/rchain/rchain/deployments","created_at":"2017-03-09T22:15:35Z","updated_at":"2018-09-25T11:28:07Z","pushed_at":"2018-09-25T11:18:12Z","git_url":"git://github.com/rchain/rchain.git","ssh_url":"git@github.com:rchain/rchain.git","clone_url":"https://github.com/rchain/rchain.git","svn_url":"https://github.com/rchain/rchain","homepage":null,"size":16974,"stargazers_count":446,"watchers_count":446,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":124,"open_issues":28,"watchers":446,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1552"},"html":{"href":"https://github.com/rchain/rchain/pull/1552"},"issue":{"href":"https://api.github.com/repos/rchain/rchain/issues/1552"},"comments":{"href":"https://api.github.com/repos/rchain/rchain/issues/1552/comments"},"review_comments":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1552/comments"},"review_comment":{"href":"https://api.github.com/repos/rchain/rchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rchain/rchain/pulls/1552/commits"},"statuses":{"href":"https://api.github.com/repos/rchain/rchain/statuses/c7f91e06d3be77a9cdec40c8ba034e1adb0f847e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"adaszko"}}