{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/91095087","pull_request_review_id":11604721,"id":91095087,"diff_hunk":"@@ -281,4 +288,18 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,\n         require(nodes.isNotEmpty())\n         nodes.forEach { if (it.started) it.stop() }\n     }\n+\n+    // Test method to block until all scheduled activity, active flows\n+    // and network activity has ceased.\n+    fun waitQuiescent() {\n+        while(nodes.any { it.smm.unfinishedFibers.count > 0","path":"test-utils/src/main/kotlin/net/corda/testing/node/MockNode.kt","position":29,"original_position":29,"commit_id":"c36677bb9bdd9225e59a09241753af1cdeb90307","original_commit_id":"c36677bb9bdd9225e59a09241753af1cdeb90307","user":{"login":"mnesbit","id":20210228,"avatar_url":"https://avatars.githubusercontent.com/u/20210228?v=3","gravatar_id":"","url":"https://api.github.com/users/mnesbit","html_url":"https://github.com/mnesbit","followers_url":"https://api.github.com/users/mnesbit/followers","following_url":"https://api.github.com/users/mnesbit/following{/other_user}","gists_url":"https://api.github.com/users/mnesbit/gists{/gist_id}","starred_url":"https://api.github.com/users/mnesbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnesbit/subscriptions","organizations_url":"https://api.github.com/users/mnesbit/orgs","repos_url":"https://api.github.com/users/mnesbit/repos","events_url":"https://api.github.com/users/mnesbit/events{/privacy}","received_events_url":"https://api.github.com/users/mnesbit/received_events","type":"User","site_admin":false},"body":"As flows exist for the lifetime of the action in practice there is always an overlap of objects lifetimes either in the scheduler, or the statemachine, or the network queues. I agree it may still have an edge condition, but I don't have a better solution at this time.","created_at":"2016-12-06T15:03:02Z","updated_at":"2016-12-06T15:03:02Z","html_url":"https://github.com/corda/corda/pull/34#discussion_r91095087","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/91095087"},"html":{"href":"https://github.com/corda/corda/pull/34#discussion_r91095087"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/34","id":96725681,"html_url":"https://github.com/corda/corda/pull/34","diff_url":"https://github.com/corda/corda/pull/34.diff","patch_url":"https://github.com/corda/corda/pull/34.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/34","number":34,"state":"open","locked":false,"title":"Add some hooks to StateMachineManager and NodeSchedulerService","user":{"login":"mnesbit","id":20210228,"avatar_url":"https://avatars.githubusercontent.com/u/20210228?v=3","gravatar_id":"","url":"https://api.github.com/users/mnesbit","html_url":"https://github.com/mnesbit","followers_url":"https://api.github.com/users/mnesbit/followers","following_url":"https://api.github.com/users/mnesbit/following{/other_user}","gists_url":"https://api.github.com/users/mnesbit/gists{/gist_id}","starred_url":"https://api.github.com/users/mnesbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnesbit/subscriptions","organizations_url":"https://api.github.com/users/mnesbit/orgs","repos_url":"https://api.github.com/users/mnesbit/repos","events_url":"https://api.github.com/users/mnesbit/events{/privacy}","received_events_url":"https://api.github.com/users/mnesbit/received_events","type":"User","site_admin":false},"body":"I have added some hooks to the NodeSchedulerService, StateMachineManager and InMemoryNetwork so that unit tests with scheduled actions can pause using net.waitQuiescent() until all node activity has finally ended. I have also added a test which uses a SchedulableState to trigger a flow and move states to another node using the FinalityFlow, so that we actually exercise this activity more than in the rather specialist scheduler tests.","created_at":"2016-12-06T13:41:53Z","updated_at":"2016-12-06T15:03:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb6a033872f472791cdbb9b0c1aa62de505f590e","assignee":{"login":"exFalso","id":1042674,"avatar_url":"https://avatars.githubusercontent.com/u/1042674?v=3","gravatar_id":"","url":"https://api.github.com/users/exFalso","html_url":"https://github.com/exFalso","followers_url":"https://api.github.com/users/exFalso/followers","following_url":"https://api.github.com/users/exFalso/following{/other_user}","gists_url":"https://api.github.com/users/exFalso/gists{/gist_id}","starred_url":"https://api.github.com/users/exFalso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exFalso/subscriptions","organizations_url":"https://api.github.com/users/exFalso/orgs","repos_url":"https://api.github.com/users/exFalso/repos","events_url":"https://api.github.com/users/exFalso/events{/privacy}","received_events_url":"https://api.github.com/users/exFalso/received_events","type":"User","site_admin":false},"assignees":[{"login":"exFalso","id":1042674,"avatar_url":"https://avatars.githubusercontent.com/u/1042674?v=3","gravatar_id":"","url":"https://api.github.com/users/exFalso","html_url":"https://github.com/exFalso","followers_url":"https://api.github.com/users/exFalso/followers","following_url":"https://api.github.com/users/exFalso/following{/other_user}","gists_url":"https://api.github.com/users/exFalso/gists{/gist_id}","starred_url":"https://api.github.com/users/exFalso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exFalso/subscriptions","organizations_url":"https://api.github.com/users/exFalso/orgs","repos_url":"https://api.github.com/users/exFalso/repos","events_url":"https://api.github.com/users/exFalso/events{/privacy}","received_events_url":"https://api.github.com/users/exFalso/received_events","type":"User","site_admin":false},{"login":"rick-r3","id":23558791,"avatar_url":"https://avatars.githubusercontent.com/u/23558791?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-r3","html_url":"https://github.com/rick-r3","followers_url":"https://api.github.com/users/rick-r3/followers","following_url":"https://api.github.com/users/rick-r3/following{/other_user}","gists_url":"https://api.github.com/users/rick-r3/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-r3/subscriptions","organizations_url":"https://api.github.com/users/rick-r3/orgs","repos_url":"https://api.github.com/users/rick-r3/repos","events_url":"https://api.github.com/users/rick-r3/events{/privacy}","received_events_url":"https://api.github.com/users/rick-r3/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/34/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/34/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/34/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/c36677bb9bdd9225e59a09241753af1cdeb90307","head":{"label":"corda:mnesbit-add-wait-hooks-for-scheduled-flow-testing","ref":"mnesbit-add-wait-hooks-for-scheduled-flow-testing","sha":"c36677bb9bdd9225e59a09241753af1cdeb90307","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2016-12-06T15:02:16Z","pushed_at":"2016-12-06T14:30:59Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":48629,"stargazers_count":257,"watchers_count":257,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":12,"forks":76,"open_issues":12,"watchers":257,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"d353825e71328c79351862cd63e42e9ed9e53a20","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2016-12-06T15:02:16Z","pushed_at":"2016-12-06T14:30:59Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":48629,"stargazers_count":257,"watchers_count":257,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":12,"forks":76,"open_issues":12,"watchers":257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/34"},"html":{"href":"https://github.com/corda/corda/pull/34"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/34"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/c36677bb9bdd9225e59a09241753af1cdeb90307"}}}}
{"actor":{"display_login":"mnesbit"}}